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

I have create a combbox using toolbarsControl Toolbox. (not used User Form)
I can populate it by altering ListFillRange in properties. What i actually
need to do is, using code i want to populate combobox with a range on a
second sheet E.G Sheet2 range A1:A10 but ommiting any blank cells in this
range.

Is this possible? Not used comboboxs before!

Please help in newbie talk!

Sunil


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default combobox

This macro will do it:

Sub FillCombo()
Dim Cel As Range
Sheets("Sheet1").ComboBox1.Clear
For Each Cel In Sheets("Sheet2").Range("A1:A10")
If Cel.Value < "" Then
Sheets("Sheet1").ComboBox1.AddItem Cel.Value
End If
Next
End Sub


question is When -and Why. You'll have to run this manually as is.

HTH. Best wishes Harald

"sunilpatel" wrote in message
...
I have create a combbox using toolbarsControl Toolbox. (not used User
Form) I can populate it by altering ListFillRange in properties. What i
actually need to do is, using code i want to populate combobox with a
range on a second sheet E.G Sheet2 range A1:A10 but ommiting any blank
cells in this range.

Is this possible? Not used comboboxs before!

Please help in newbie talk!

Sunil


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


Thanks but, i am getting an error message. "Object does'nt support this
property or method"

Please help



"Harald Staff" wrote in message
...
This macro will do it:

Sub FillCombo()
Dim Cel As Range
Sheets("Sheet1").ComboBox1.Clear
For Each Cel In Sheets("Sheet2").Range("A1:A10")
If Cel.Value < "" Then
Sheets("Sheet1").ComboBox1.AddItem Cel.Value
End If
Next
End Sub


question is When -and Why. You'll have to run this manually as is.

HTH. Best wishes Harald

"sunilpatel" wrote in message
...
I have create a combbox using toolbarsControl Toolbox. (not used User
Form) I can populate it by altering ListFillRange in properties. What i
actually need to do is, using code i want to populate combobox with a
range on a second sheet E.G Sheet2 range A1:A10 but ommiting any blank
cells in this range.

Is this possible? Not used comboboxs before!

Please help in newbie talk!

Sunil




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
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
Combobox options based on the input of another combobox afmullane[_5_] Excel Programming 1 May 3rd 06 01:44 PM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 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


All times are GMT +1. The time now is 08:03 AM.

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

About Us

"It's about Microsoft Excel"