L
L. Howard
The commented out line is giving me fits.
The MsgBox line is correct but I'm muddled on making the resize/copy work.
Thanks,
Howard
Sub MeFindIt()
Dim rngFound As Range
Dim myFnd As String
myFnd = Sheets("Sheet1").Range("B2")
Set rngFound = Sheets("Sheet2").Range("B:B").Find(What:=myFnd, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rngFound Is Nothing Then
'rngFound.Offset(, 1).Resize.Cells(1, Columns.Count).End(xlToLeft).Column.Copy Sheets("Sheet1").Range("C2")
MsgBox "Match for " & """" & myFnd & """" & " in cell " & rngFound.Address
Else
MsgBox "No match found. "
End If
End Sub
The MsgBox line is correct but I'm muddled on making the resize/copy work.
Thanks,
Howard
Sub MeFindIt()
Dim rngFound As Range
Dim myFnd As String
myFnd = Sheets("Sheet1").Range("B2")
Set rngFound = Sheets("Sheet2").Range("B:B").Find(What:=myFnd, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rngFound Is Nothing Then
'rngFound.Offset(, 1).Resize.Cells(1, Columns.Count).End(xlToLeft).Column.Copy Sheets("Sheet1").Range("C2")
MsgBox "Match for " & """" & myFnd & """" & " in cell " & rngFound.Address
Else
MsgBox "No match found. "
End If
End Sub