lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I have a table with 2 columns, Name and Phone# column. I wrote vlookup code (see below) and it is working fine. I want to modified it so that excel will highlight the row that contains that name and phone number. Is that possible? Thank you so much.
++
Sub price()
Dim item As String
Dim x As String
item = InputBox("enter Name")
Sheets("price").Activate
x = WorksheetFunction.VLookup(item, Range("A2:B171"), 2, False)
MsgBox item & " phone# is --> " & x
End Sub
I have a table with 2 columns, Name and Phone# column. I wrote vlookup code (see below) and it is working fine. I want to modified it so that excel will highlight the row that contains that name and phone number. Is that possible? Thank you so much.
++
Sub price()
Dim item As String
Dim x As String
item = InputBox("enter Name")
Sheets("price").Activate
x = WorksheetFunction.VLookup(item, Range("A2:B171"), 2, False)
MsgBox item & " phone# is --> " & x
End Sub