excel VBA 提取数据问题
当前只提取B列怎么提取B,C两列?Sub提取A表T列的空数据()Dimarr,i&,j&Sheet4.Range("h:h").ClearContentsarr=Shee...
当前只提取B列 怎么 提取 B,C两列?
Sub 提取A表T列的空数据()
Dim arr, i&, j&
Sheet4.Range("h:h").ClearContents
arr = Sheet1.UsedRange
For i = 2 To UBound(arr)
If Len(arr(i, 2)) > 0 Then
If Len(arr(i, 20)) = 0 Or arr(i, 20) = 0 Then
k = k + 1
Sheet4.Cells(k + 1, 8) = arr(i, 2)
End If
End If
Next
MsgBox "好"
End Sub 展开
Sub 提取A表T列的空数据()
Dim arr, i&, j&
Sheet4.Range("h:h").ClearContents
arr = Sheet1.UsedRange
For i = 2 To UBound(arr)
If Len(arr(i, 2)) > 0 Then
If Len(arr(i, 20)) = 0 Or arr(i, 20) = 0 Then
k = k + 1
Sheet4.Cells(k + 1, 8) = arr(i, 2)
End If
End If
Next
MsgBox "好"
End Sub 展开
2个回答
展开全部
Sub 提取A表T列的空数据()
Dim arr, i&, j&
Sheet4.Range("h:i").ClearContents
arr = Sheet1.UsedRange
For i = 2 To UBound(arr)
If Len(arr(i, 2)) > 0 Then
If Len(arr(i, 20)) = 0 Or arr(i, 20) = 0 Then
k = k + 1
Sheet4.Cells(k + 1, 8) = arr(i, 2)
Sheet4.Cells(k + 1, 9) = arr(i, 3)
End If
End If
Next
MsgBox "好"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询