我有一个问题,我想做一些简单的代码,检查值,然后会发现下一个没有空单元格。我试着这样做,但我有问题:
Sub test()
Dim ark1 As Worksheet, ark2 As Worksheet
Dim i As Long, j As Long, lastRow As Long, nextRow As Long, actCell As Long, actCell2 As Long
Set ark1 = Worksheets("Arkusz1")
Set ark1 = Worksheets("Arkusz2")
For i = 1 To 20
If ark1.Cells(i, "A") = ark1.Cells(1, "B") Then
ark1.Cells(i, 1).Select
actCell = ActiveCell.Row
MsgBox actCell
End If
Next i
For i = actCell To 20
ark1.Cells(i, "A").Select
If IsEmpty(ActiveCell) Then
Next i
Else
ark1.Cells(i, "A") = 1
End If
Next i
End Sub
1条答案
按热度按时间dgtucam11#
感谢JvdV我找到了解决方案,也许它会对某人有用: