J
jonco
I need to modify a macro. This macro finds the first instance of a name
and then displays a dialog box telling the user that it has found the name
and it's row location. I need the macro to Select the row that it has found
(so the user can see it on the screen.) or at least scroll so it is visible.
It would be good to highlight it in some manner.
Here is the macro as it is now:
'Sub FindPastDue()
' FindPastDue Macro
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set namerange = Range(Cells(1, "A"), Cells(Lastrow, "A"))
SearchName = InputBox("Enter Name to Find: ")
Set C = namerange.Find(SearchName, LookIn:=xlValues)
If Not C Is Nothing Then
MsgBox ("Found name: " & c & " on line " & CStr(c.Row))
Else
MsgBox ("Did not find: " & SearchName)
End If
'
End Sub
and then displays a dialog box telling the user that it has found the name
and it's row location. I need the macro to Select the row that it has found
(so the user can see it on the screen.) or at least scroll so it is visible.
It would be good to highlight it in some manner.
Here is the macro as it is now:
'Sub FindPastDue()
' FindPastDue Macro
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set namerange = Range(Cells(1, "A"), Cells(Lastrow, "A"))
SearchName = InputBox("Enter Name to Find: ")
Set C = namerange.Find(SearchName, LookIn:=xlValues)
If Not C Is Nothing Then
MsgBox ("Found name: " & c & " on line " & CStr(c.Row))
Else
MsgBox ("Did not find: " & SearchName)
End If
'
End Sub