Vlookup in vba stopped working after updating excel

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,681
Office Version
  1. 365
Platform
  1. 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.

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
AB
1namephone#
2mary1416-111-1111
3mike1416-123-1515
4john1647-222-3333
5sarah1905-147-0101
6david1416-111-0001
7anna1416-123-1516
8alex1647-222-3334
9liz1905-147-0102
phone
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
1,043
Office Version
  1. 2016
Platform
  1. Windows
This probably related to bug.

If you Google, people are complaining about macro not working after update. :(
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,128,015
Messages
5,628,147
Members
416,295
Latest member
jjkh58

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top