checkbox vlookup

sappster

New Member
Joined
Aug 24, 2011
Messages
9
Does anyone know of a way to allow a cell on my sheet be updated by a vlookup property when a checkbox is clicked? I have 4 comboboxes and when the last combox is selected I need that part number to be looked up by the checkbox if its selected and have that value put into another cell.
 
This code should do what you want.

If CheckBox1.Value Then
drawer = Application.WorksheetFunction.VLookup(ComboBox4.Value, Worksheets("data").Range("A1:B10"), 2, 0)
End If

- Change checkbox1 to the name of your checkbox control.
- Change combobox4 to the name of your combox control.
- Change data to the name of your worksheet.
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You have drawer =. But this variable has not been defined. How would I define it so this formula will work?
 
Upvote 0
I just used "drawer" as an example. You may assign the result of the formula to some other variable that you already have in the code.

Since the drawer models are strings, you need to use "Dim drawer as String" to declare the variable. The code will still work without the declaration but it is a good practice to declare it.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

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
Back
Top