我用VBA做的,你看一下- Sub dd()
- x = ActiveSheet.Range("H65535").End(xlUp).Row
- y = ActiveSheet.Range("N65535").End(xlUp).Row
- k = 1
- For i = 1 To x
- If Cells(i, 8) <> "" Then
- Cells(k, 1) = Cells(i, 8)
- Cells(k, 2) = Cells(i, 9)
- Cells(k, 3) = Cells(i, 10)
- Cells(k, 4) = Cells(i, 11)
- Cells(k, 5) = Cells(i, 12)
- k = k + 1
- End If
- Next
- For j = 1 To y
- If Cells(j, 14) <> "" Then
- Cells(k, 1) = Cells(j, 14)
- Cells(k, 2) = Cells(j, 15)
- Cells(k, 3) = Cells(j, 16)
- Cells(k, 4) = Cells(j, 17)
- Cells(k, 5) = Cells(j, 18)
- k = k + 1
- End If
- Next
- End Sub
复制代码
|