|
在第1行1列输入值后查询到第一列符合条件的相应的行
红色部分一直改一直出错
Private Sub Worksheet_Change(ByVal Target As Range)
Dim b As String
Dim c As Range
Dim d
If Target.Address(0, 0) = "A1" Then
'Range("A2:j21").Borders.LineStyle = xlNone
Target.Value = UCase(Target.Value)
b = Target.Value
Set c = Range(”A2:A20").Find(b, lookat:=xlWhole)
If Not c Is Nothing Then
d = c.Row
ActiveWindow.ScrollRow = d
'Range("A3:j3").BorderAround xlContinuous, xlThick, ColorIndex:=3
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim b As String
Dim c As Range
Dim d
Application.EnableEvents = False
If Target.Address(0, 0) = "A1" Then
'Range("A2:j21").Borders.LineStyle = xlNone
Target.Value = UCase(Target.Value)
b = Target.Value
Set c = Range("A2:A20").Find(b, lookat:=xlWhole)
If Not c Is Nothing Then
d = c.Row
ActiveWindow.ScrollRow = d
'Range("A3:j3").BorderAround xlContinuous, xlThick, ColorIndex:=3
End If
End If
Application.EnableEvents = True
End Sub
|
|