Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Null in a ComboBox.List

I'm looping thru a combobox list it works fine but at the end shows a Null
error.
I tried adding " -1" at the end but won't work either since all the items
are all strings

For Each ccc In CbxAddress.List
MsgBox ccc
Next ccc


Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Null in a ComboBox.List

On Oct 8, 8:14 pm, LuisE wrote:
I'm looping thru a combobox list it works fine but at the end shows a Null
error.
I tried adding " -1" at the end but won't work either since all the items
are all strings

For Each ccc In CbxAddress.List
MsgBox ccc
Next ccc

Thanks in advance


Hello LuisE,

Here are the looping methods for both the Forms and Control Toolbox
controls.

Sub FormsComboBox()

Dim Itm

For Each Itm In ActiveSheet.DropDowns("Drop Down 1").List
MsgBox Itm
Next Itm

End Sub


Sub ToolboxComboBox()

Dim Cbo As Object
Dim Itm

Set Cbo = ActiveSheet.OLEObjects("ComboBox1").Object
For Each Itm In Cbo.List
MsgBox Itm
Next Itm

End Sub


Sincerely,
Leith Ross

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Null in a ComboBox.List

Thanks Leith

I continue having the same error message.
My Combobox is in a UserForm, loops thru the whole list and at last it the
variable shows Null

"Leith Ross" wrote:

On Oct 8, 8:14 pm, LuisE wrote:
I'm looping thru a combobox list it works fine but at the end shows a Null
error.
I tried adding " -1" at the end but won't work either since all the items
are all strings

For Each ccc In CbxAddress.List
MsgBox ccc
Next ccc

Thanks in advance


Hello LuisE,

Here are the looping methods for both the Forms and Control Toolbox
controls.

Sub FormsComboBox()

Dim Itm

For Each Itm In ActiveSheet.DropDowns("Drop Down 1").List
MsgBox Itm
Next Itm

End Sub


Sub ToolboxComboBox()

Dim Cbo As Object
Dim Itm

Set Cbo = ActiveSheet.OLEObjects("ComboBox1").Object
For Each Itm In Cbo.List
MsgBox Itm
Next Itm

End Sub


Sincerely,
Leith Ross


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
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Combobox list to leave ONLY related values in list ?? Corey Excel Programming 2 January 4th 07 09:13 PM
Combobox List to list Numerical Values ONLY in Column A is specific Sheet.... Corey Excel Programming 5 December 28th 06 10:40 AM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 PM
Excluding NULL values in an Excel List Sheri Excel Programming 3 April 25th 05 03:48 PM


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

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"