lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
The code below used to work fine. I updated office and now the code stopped working. Any idea why? Thank you so much.
The table is this (part of it)
The code below used to work fine. I updated office and now the code stopped working. Any idea why? Thank you so much.
Code:
Sub price()
Dim item As String
Dim x As String
item = InputBox("enter Name")
Sheets("phone").Activate
x = WorksheetFunction.VLookup(item, Range("A2:B171"), 2, False)
MsgBox item & " phone# is --> " & x
End Sub
The table is this (part of it)
demo (1).xlsm | ||||
---|---|---|---|---|
A | B | |||
1 | name | phone# | ||
2 | mary1 | 416-111-1111 | ||
3 | mike1 | 416-123-1515 | ||
4 | john1 | 647-222-3333 | ||
5 | sarah1 | 905-147-0101 | ||
6 | david1 | 416-111-0001 | ||
7 | anna1 | 416-123-1516 | ||
8 | alex1 | 647-222-3334 | ||
9 | liz1 | 905-147-0102 | ||
phone |