Hello,
I am pretty new to VBA and have been wrecking my brain and reading just about every Thread there is on this and still can't figure out why I am not getting the code to work.
I am trying to get data from Column "Sale Price", stored in Table "MasterInventory" on worksheet "Master Inventory" to populate a textbox in a UserForm by means of Vlookup.
Upon running the code below I'm getting Value Error 1004, and during Debug when I hover over "MasterInventory" it shows "MasterInventory=Empty"
Also Im trying to figure out how to do it so I can call the "userform" up from any worksheet and add the entries in the table on worksheet (Jan, Feb, Mar, etc.) for the month depicted in the TextBox "Date" on the Userform
If anybody can help I would highly appreciate it.
The code looks like this:
Thanks in advance.
I am pretty new to VBA and have been wrecking my brain and reading just about every Thread there is on this and still can't figure out why I am not getting the code to work.
I am trying to get data from Column "Sale Price", stored in Table "MasterInventory" on worksheet "Master Inventory" to populate a textbox in a UserForm by means of Vlookup.
Upon running the code below I'm getting Value Error 1004, and during Debug when I hover over "MasterInventory" it shows "MasterInventory=Empty"
Also Im trying to figure out how to do it so I can call the "userform" up from any worksheet and add the entries in the table on worksheet (Jan, Feb, Mar, etc.) for the month depicted in the TextBox "Date" on the Userform
If anybody can help I would highly appreciate it.
The code looks like this:
Code:
[COLOR=#333333]
[SIZE=1]Private Sub CBx_PROD_AfterUpdate()[/SIZE][/COLOR]
[SIZE=1][COLOR=#333333]'lookup value in Col F [Sale Price] based on Product (Col A [Description] in Table [MasterInventory])[/COLOR][/SIZE]
[SIZE=1][COLOR=#333333]With TB_SP[/COLOR]
[COLOR=#333333]If OB_Y.Value = True Then[/COLOR]
[COLOR=#333333]Me.TB_SP.Value = Application.WorksheetFunction.VLookup(CBx_PROD.Value, MasterInventory, 6, False).Value[/COLOR]
[COLOR=#333333]End If[/COLOR]
[COLOR=#333333]If CBx_PROD.Value = "" Then[/COLOR]
[COLOR=#333333]Exit Sub[/COLOR]
[COLOR=#333333]End If[/COLOR]
[COLOR=#333333]End With[/COLOR]
[COLOR=#333333]End Sub[/COLOR][/SIZE]
Thanks in advance.