How to invoke VLookUp function in Excel VBA.
Closed
Wingie
-
Mar 15, 2016 at 05:19 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 15, 2016 at 12:21 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 15, 2016 at 12:21 PM
Related:
- How to invoke VLookUp function in Excel VBA.
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- How to take screenshot in excel - Guide
- How to open vba in excel mac - Guide
- How to change author in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Mar 15, 2016 at 12:21 PM
Mar 15, 2016 at 12:21 PM
Hi Wingie,
When the matrix is located in sheet 2 A1:B5, the value to look up is in sheet1 A1 and the result in sheet1 B1, then the code will look like this:
Best regards,
Trowa
When the matrix is located in sheet 2 A1:B5, the value to look up is in sheet1 A1 and the result in sheet1 B1, then the code will look like this:
Sub RunMe() Sheets("Sheet1").Range("B1").Value = Application.WorksheetFunction. _ VLookup(Sheets("Sheet1").Range("A1"), Sheets("Sheet2").Range("A1:B5"), 2) End Sub
Best regards,
Trowa