How to use values stored in a combo box control?

A

Arlen

I have just made a combo box with 5 option(s). It is hovering above B2, but
it is not in B2.

If I wanted to use the value of the combo box in a formula elsewhere, how do
I reference that?

Bonus: I have a Calendar UserForm. Right now, it places the date in
whatever cell was selected when I clicked it. How, instead, can I aim it at
a particular cell every time? And how do you lock your buttons, controls in
place in your spreadsheet?

Thanks for your time.

Arlen
 
G

Gary Brown

In the 'LinkedCell' property of the combobox, put 'B2'. Any selections will
be put in Cell B2 which you can now reference in formulas.
Bonus: Right click on the combobox in design mode. Select 'Format
Control'. Select the 'Properties' tab.
Select 'Don't move or size with cells'.
 
A

Arlen

Gary,

Thank you, sir. That combo box was easy enough.

One quick thing. The calendar I mentioned is controlled by an icon image I
drew (not a UserControl) to which I assigned an openCalendar macro. I put
the icon floating over C4, C6, C23 and C25.

How do I fix the code to put the dates in B4, B6, B23 and B25, respectively,
rather than putting the date in whatever was the last cell selected?

Thanks again for your help.

Arlen
 
G

Gary Brown

If your calendar form is called 'axCalendar', then you can put...
Range("B4").Value = axCalendar.Value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top