G
Guest
I have this code :-
Private Sub CommandButton1_Click()
Dim FW As Variant
Dim rngCell As Range
FW = Worksheets("LU").Cells(1, 1).Value
With Worksheets("Detail")
Set rngCell = .Cells.Find(What:=FW, _
After:=.Cells(1, 1), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
End With
If Not rngCell Is Nothing Then
MsgBox rngCell.Row
End If
End Sub
Worksheets("LU").Cells(1, 1) contains value "109435"
When running I get error "Run-time error 1004 - Unable to get the Find
Property of the Range Class"
Any ideas?
Private Sub CommandButton1_Click()
Dim FW As Variant
Dim rngCell As Range
FW = Worksheets("LU").Cells(1, 1).Value
With Worksheets("Detail")
Set rngCell = .Cells.Find(What:=FW, _
After:=.Cells(1, 1), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
End With
If Not rngCell Is Nothing Then
MsgBox rngCell.Row
End If
End Sub
Worksheets("LU").Cells(1, 1) contains value "109435"
When running I get error "Run-time error 1004 - Unable to get the Find
Property of the Range Class"
Any ideas?