![]() |
Using Vlookup in VBA
In excel I have created a user form, in which there is a label
("nonfincalcLabel"). I am trying to change the Caption of the label based on a calculation using Vlookup when a change is made to one of the comboboxes. The lookup table range is defined as "nonfinRange" in the worksheet "nonfinTable". When i try to run the code it says, Run-time error '1004': Unable to get the Vlookup property of the WorksheetFunction class. Below is my code, where am i going wrong? Private Sub defaulthistoryCombo_Change() Dim searchRange As Range Set searchRange = Worksheets("nonfinTable").Range("nonfinRange") nonfincalcLabel.Caption = Application.WorksheetFunction.VLookup(xCombo.Value , searchRange, 3, False) + Application.WorksheetFunction.VLookup(yCombo.Value , searchRange, 5, False) End Sub |
Using Vlookup in VBA
You have response to your other post in public.excel
-- --- HTH Bob (change the xxxx to gmail if mailing direct) "prahz" wrote in message ups.com... In excel I have created a user form, in which there is a label ("nonfincalcLabel"). I am trying to change the Caption of the label based on a calculation using Vlookup when a change is made to one of the comboboxes. The lookup table range is defined as "nonfinRange" in the worksheet "nonfinTable". When i try to run the code it says, Run-time error '1004': Unable to get the Vlookup property of the WorksheetFunction class. Below is my code, where am i going wrong? Private Sub defaulthistoryCombo_Change() Dim searchRange As Range Set searchRange = Worksheets("nonfinTable").Range("nonfinRange") nonfincalcLabel.Caption = Application.WorksheetFunction.VLookup(xCombo.Value , searchRange, 3, False) + Application.WorksheetFunction.VLookup(yCombo.Value , searchRange, 5, False) End Sub |
Using Vlookup in VBA
See your other post.
prahz wrote: In excel I have created a user form, in which there is a label ("nonfincalcLabel"). I am trying to change the Caption of the label based on a calculation using Vlookup when a change is made to one of the comboboxes. The lookup table range is defined as "nonfinRange" in the worksheet "nonfinTable". When i try to run the code it says, Run-time error '1004': Unable to get the Vlookup property of the WorksheetFunction class. Below is my code, where am i going wrong? Private Sub defaulthistoryCombo_Change() Dim searchRange As Range Set searchRange = Worksheets("nonfinTable").Range("nonfinRange") nonfincalcLabel.Caption = Application.WorksheetFunction.VLookup(xCombo.Value , searchRange, 3, False) + Application.WorksheetFunction.VLookup(yCombo.Value , searchRange, 5, False) End Sub -- Dave Peterson |
All times are GMT +1. The time now is 12:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com