Vlookup in vba stopped working after updating excel

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,671
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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
951
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,127,098
Messages
5,622,673
Members
415,920
Latest member
ExcelNoob28

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