vba怎样按组自动识别并选择向下第一个空单元格!谢!!

2024-12-02 22:05:47
推荐回答(1个)
回答1:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$3" Then
Dim i As Integer
Dim x As Range
Set x = Sheets("88").Range("c1:c" & Sheets("88").Cells(Rows.Count, 3).End(xlUp).Row).Find(Target.Value, , , 2, , xlPrevious)
If Not x Is Nothing Then
Sheets("88").Select
Sheets("88").Range("c" & x.Row + 1).Select
End If
End If
End Sub