ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add item to comboBox "form" from vba (https://www.excelbanter.com/excel-programming/315359-add-item-combobox-form-vba.html)

0000_AAAA_0000[_6_]

Add item to comboBox "form" from vba
 

Hi!

how can I add 2 items say "QAZ" and "WSX" to a ComboBox inserted in th
activesheet using the forms toollbar


from VBA


Sub help()
with activesheet.combobox1
.additem "QAZ"
.additem "WSX"
end with
'this work when the combobox comes from the activecontrols toolbars bu
when 'from the other toolbar?
ens sub


many thanks

--
0000_AAAA_000
-----------------------------------------------------------------------
0000_AAAA_0000's Profile: http://www.excelforum.com/member.php...fo&userid=1248
View this thread: http://www.excelforum.com/showthread.php?threadid=27407


Tom Ogilvy

Add item to comboBox "form" from vba
 
Sub help()
with activesheet.DropDowns(1)
.additem "QAZ"
.additem "WSX"
end with
end sub

Replace the 1 with the name of the dropdown (found in the name box when the
control is selected) if you wish.

--
Regards,
Tom Ogilvy


"0000_AAAA_0000" wrote in
message ...

Hi!

how can I add 2 items say "QAZ" and "WSX" to a ComboBox inserted in the
activesheet using the forms toollbar


from VBA


Sub help()
with activesheet.combobox1
additem "QAZ"
additem "WSX"
end with
'this work when the combobox comes from the activecontrols toolbars but
when 'from the other toolbar?
ens sub


many thanks!


--
0000_AAAA_0000
------------------------------------------------------------------------
0000_AAAA_0000's Profile:

http://www.excelforum.com/member.php...o&userid=12480
View this thread: http://www.excelforum.com/showthread...hreadid=274076





All times are GMT +1. The time now is 05:40 PM.

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