Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings. I am loading a combo box list on the initialize event with code I
found here, and it works perfectly. For Each sh In ActiveWorkbook.Sheets Me.ComboBox1.AddItem sh.Name Next However, there are two sheets, the last two that I don't want to show up in the list. I can't find an easy way to keep these two sheets out. Any ideas? Thank you. Greg |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, that was easy.
For Each sh In ActiveWorkbook.Sheets If sh.Name < "BDMS" And sh.Name < "HELD" Then Me.ComboBox1.AddItem sh.Name End If Next "Greg Snidow" wrote: Greetings. I am loading a combo box list on the initialize event with code I found here, and it works perfectly. For Each sh In ActiveWorkbook.Sheets Me.ComboBox1.AddItem sh.Name Next However, there are two sheets, the last two that I don't want to show up in the list. I can't find an easy way to keep these two sheets out. Any ideas? Thank you. Greg |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If it's always the last 2 sheets you don't want then you could use this which
would be a tade shorter. Hope this helps! If so, let me know, click "YES" below. For wks = 1 To Sheets.Count - 2 Me.ComboBox1.AddItem Sheets(wks).Name Next wks -- Cheers, Ryan "Greg Snidow" wrote: Ok, that was easy. For Each sh In ActiveWorkbook.Sheets If sh.Name < "BDMS" And sh.Name < "HELD" Then Me.ComboBox1.AddItem sh.Name End If Next "Greg Snidow" wrote: Greetings. I am loading a combo box list on the initialize event with code I found here, and it works perfectly. For Each sh In ActiveWorkbook.Sheets Me.ComboBox1.AddItem sh.Name Next However, there are two sheets, the last two that I don't want to show up in the list. I can't find an easy way to keep these two sheets out. Any ideas? Thank you. Greg |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the tip. That is actually what I was trying to do, but I was
making it much more complicated than you have done. "Ryan H" wrote: If it's always the last 2 sheets you don't want then you could use this which would be a tade shorter. Hope this helps! If so, let me know, click "YES" below. For wks = 1 To Sheets.Count - 2 Me.ComboBox1.AddItem Sheets(wks).Name Next wks -- Cheers, Ryan "Greg Snidow" wrote: Ok, that was easy. For Each sh In ActiveWorkbook.Sheets If sh.Name < "BDMS" And sh.Name < "HELD" Then Me.ComboBox1.AddItem sh.Name End If Next "Greg Snidow" wrote: Greetings. I am loading a combo box list on the initialize event with code I found here, and it works perfectly. For Each sh In ActiveWorkbook.Sheets Me.ComboBox1.AddItem sh.Name Next However, there are two sheets, the last two that I don't want to show up in the list. I can't find an easy way to keep these two sheets out. Any ideas? Thank you. Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loading a Combo Box with the months of the year | Excel Discussion (Misc queries) | |||
Combo Box Loading | Excel Programming | |||
Loading list and combo boxes from startup | Excel Programming | |||
Loading Number Formats into Combo Box | Excel Programming | |||
Loading Sheet Names into Combo Box | Excel Programming |