#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox


Hi Dears,

I want to build two Combo Boxes i.e ComboBox1 having range "a1: a50"
and ComboBox2 having range "c1:c25". on a same userForm.

for a simple single comboBox we use these codes

Private sub userForm_activate()

Sheet1.activate
ComboBox1.columncount=1
Combobox1.rowsource="a1:a50"

end sub

but i need code to show Combobox2 on the same userForm have range
"c1:c25" as well as combobox1 having range "a1:a50".



Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=467474

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default ComboBox

This seems too obvious, so I may b e missing something

Private sub userForm_activate()

Sheet1.activate
ComboBox1.columncount=1
Combobox1.rowsource="a1:a50"
ComboBox2.columncount = 1
Combobox2.rowsource = "C1:C25"


end sub


--
HTH

Bob Phillips

"Syed Haider Ali"
<Syed.Haider.Ali.1vco2c_1126703136.4879@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1vco2c_1126703136.4879@excelf orum-nospam.com...

Hi Dears,

I want to build two Combo Boxes i.e ComboBox1 having range "a1: a50"
and ComboBox2 having range "c1:c25". on a same userForm.

for a simple single comboBox we use these codes

Private sub userForm_activate()

Sheet1.activate
ComboBox1.columncount=1
Combobox1.rowsource="a1:a50"

end sub

but i need code to show Combobox2 on the same userForm have range
"c1:c25" as well as combobox1 having range "a1:a50".



Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox


Thanks Bob. I got it.

One thing more can we set a default value at combobox whenever we run
a userForm.

Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=467474

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default ComboBox

You can set an item to show as selected if that is what you mean by setting
the value of ListIndex.

--
HTH

Bob Phillips

"Syed Haider Ali"
<Syed.Haider.Ali.1vcz6t_1126717532.0969@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1vcz6t_1126717532.0969@excelf orum-nospam.com...

Thanks Bob. I got it.

One thing more can we set a default value at combobox whenever we run
a userForm.

Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox


Can you explain more in detail with the help of codes

Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994
View this thread: http://www.excelforum.com/showthread...hreadid=467474



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default ComboBox

Combobox1.ListIndex = 2

will select the third item.

--
HTH

Bob Phillips

"Syed Haider Ali"
<Syed.Haider.Ali.1ved6i_1126782329.4465@excelfor um-nospam.com wrote in
message news:Syed.Haider.Ali.1ved6i_1126782329.4465@excelf orum-nospam.com...

Can you explain more in detail with the help of codes

Thanks

Syed Haider Ali


--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
Populating combobox from another combobox David Goodall Excel Programming 1 September 12th 04 03:42 PM
VBA ComboBox Stromma Excel Programming 2 February 23rd 04 11:22 PM
Combobox Tony G[_2_] Excel Programming 1 October 24th 03 01:53 PM


All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"