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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
What type of combobox is it?
 

radlernyc

Board Regular
Joined
Jun 9, 2005
Messages
69
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
And how is the code not 'working'?

Where is the code located?
 

radlernyc

Board Regular
Joined
Jun 9, 2005
Messages
69

ADVERTISEMENT

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"
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
What event is it in?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows

radlernyc

Board Regular
Joined
Jun 9, 2005
Messages
69
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,546
Messages
5,838,021
Members
430,526
Latest member
NiceGuyWithExcel2007

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
Top