ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Value of ComboBox on Custom CommandBar (https://www.excelbanter.com/excel-programming/287942-value-combobox-custom-commandbar.html)

Kevin

Value of ComboBox on Custom CommandBar
 
I've created a custom commandbar that has a combobox and
a button. I want to be able to choose a value from the
combobox, click the button, and have that run a macro
based on the value that is in the ComboBox. Does anyone
know how to return this value?

Thanks for your help!
Kevin

Tim Zych[_4_]

Value of ComboBox on Custom CommandBar
 
Application.CommandBars.FindControl(Tag:="cbo_tag" ).Text

if the tag property was used.

"Kevin" wrote in message
...
I've created a custom commandbar that has a combobox and
a button. I want to be able to choose a value from the
combobox, click the button, and have that run a macro
based on the value that is in the ComboBox. Does anyone
know how to return this value?

Thanks for your help!
Kevin




Kevin

Value of ComboBox on Custom CommandBar
 
Tim,

Thanks for the help. I've never used the tag property
before, but I'll look into that and try to make this work.

Thanks again,
Kevin

-----Original Message-----
Application.CommandBars.FindControl(Tag:="cbo_tag ").Text

if the tag property was used.

"Kevin" wrote in

message
...
I've created a custom commandbar that has a combobox

and
a button. I want to be able to choose a value from the
combobox, click the button, and have that run a macro
based on the value that is in the ComboBox. Does

anyone
know how to return this value?

Thanks for your help!
Kevin



.


Tim Zych[_4_]

Value of ComboBox on Custom CommandBar
 
So when you create the combobox:

With .Controls.Add(Type:=msoControlComboBox, Temporary:=True)
.AddItem "something"
.AddItem "something else"
.OnAction = "MyMacro"
.Tag = "cbo_tag"
End With


"Kevin" wrote in message
...
Tim,

Thanks for the help. I've never used the tag property
before, but I'll look into that and try to make this work.

Thanks again,
Kevin

-----Original Message-----
Application.CommandBars.FindControl(Tag:="cbo_tag ").Text

if the tag property was used.

"Kevin" wrote in

message
...
I've created a custom commandbar that has a combobox

and
a button. I want to be able to choose a value from the
combobox, click the button, and have that run a macro
based on the value that is in the ComboBox. Does

anyone
know how to return this value?

Thanks for your help!
Kevin



.




Kevin

Value of ComboBox on Custom CommandBar
 
Tim,

This works exactly how I want it to- thank you for your
help and follow through!

Take care,
Kevin

-----Original Message-----
So when you create the combobox:

With .Controls.Add(Type:=msoControlComboBox,

Temporary:=True)
.AddItem "something"
.AddItem "something else"
.OnAction = "MyMacro"
.Tag = "cbo_tag"
End With


"Kevin" wrote in

message
...
Tim,

Thanks for the help. I've never used the tag property
before, but I'll look into that and try to make this

work.

Thanks again,
Kevin

-----Original Message-----
Application.CommandBars.FindControl

(Tag:="cbo_tag").Text

if the tag property was used.

"Kevin" wrote in

message
...
I've created a custom commandbar that has a combobox

and
a button. I want to be able to choose a value from

the
combobox, click the button, and have that run a

macro
based on the value that is in the ComboBox. Does

anyone
know how to return this value?

Thanks for your help!
Kevin


.



.



All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com