![]() |
macro to enter variable in combobox
(Using VBA) I have a userForm which contains a ComboBox - data can be entered
into the Userform manually or via a macro (ie. some of the data is contained in variables). How can I use a variable to make an entry in a Combo box - I am not talking of creating a range etc. - think of it as if a user was entering text via the keyboard. MervB :-) |
macro to enter variable in combobox
Try:
Dim myStr As String myStr = "The Value" Me.ComboBox1.AddItem myStr Hope this helps Rowan MervB wrote: (Using VBA) I have a userForm which contains a ComboBox - data can be entered into the Userform manually or via a macro (ie. some of the data is contained in variables). How can I use a variable to make an entry in a Combo box - I am not talking of creating a range etc. - think of it as if a user was entering text via the keyboard. MervB :-) |
macro to enter variable in combobox
Tanks
"Rowan Drummond" wrote: Try: Dim myStr As String myStr = "The Value" Me.ComboBox1.AddItem myStr Hope this helps Rowan MervB wrote: (Using VBA) I have a userForm which contains a ComboBox - data can be entered into the Userform manually or via a macro (ie. some of the data is contained in variables). How can I use a variable to make an entry in a Combo box - I am not talking of creating a range etc. - think of it as if a user was entering text via the keyboard. MervB :-) |
All times are GMT +1. The time now is 09:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com