If Statement Combo Box

radlernyc

Board Regular
Joined
Jun 9, 2005
Messages
69
cb_BdMtgFee.value is a combo box with Yes and No as choices. I want to place an X in a cell if yes is selected. The code below does not work. Thanks for the help


Code:
If cb_BdMtgFee.value = "Yes" Then

    ws.Range("AW" & LastRow) = "X"
    
Else

    ws.Range("AW" & LastRow) = ""

End If
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
The comb box is in a vb userform. Its rowsource is a named range. The two value in the named range are Yes and No
 
Upvote 0
And how is the code not 'working'?

Where is the code located?
 
Upvote 0
The code is located in an event. Command OK fills a data sheet with the values from the form. When combo box is "Yes" it should fill a range with an X. It currently is not working, meaning the combo box is yes but the range does not receive an X.

ws.Range("AW" & LastRow) = "X"
 
Upvote 0
On Click of a Command Button. On click all values are dumped into a sheet. However, I need the some cells to have an X in them, not "Yes". So I need a piece of code that logicall reads something like this:

If combobox is Yes Then

Cell A5 = x

End If


I have tried multiple variations of this logic, but havent gotten right yet. Thanks for the help
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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