Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Clearing list from all form commandboxes

attn: Tom Oglivy or anyone else who may be able to help...

I need help Clearing the list from all form commandboxes
on my worksheet, the code I had earlier didn't seem to
work correctly, or I was using it wrong, could someone
please help me with this?
Thanks in advance,
Josh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Clearing list from all form commandboxes

Hi Josh:

What is a "commandbox"?

If you mean ComboBoxes:

Sheet1.ComboBox1.Clear
Sheet1.ComboBox2.Clear

etc.

You cannot clear ComboBoxes in this fashion if they are populated via a
RowSource.

Regards,

Vasant.



"josh ashcraft" wrote in message
...
attn: Tom Oglivy or anyone else who may be able to help...

I need help Clearing the list from all form commandboxes
on my worksheet, the code I had earlier didn't seem to
work correctly, or I was using it wrong, could someone
please help me with this?
Thanks in advance,
Josh



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clearing list from all form commandboxes

Some mo

These all worked for comboboxes (dropdowns) from the Forms Toolbar:

Sub ClearListFill()
Dim drp As DropDown
For Each drp In ActiveSheet.DropDowns
drp.ListFillRange = ""
Next
End Sub

Sub Populate()
Dim drp As DropDown
For Each drp In ActiveSheet.DropDowns
drp.RemoveAllItems
drp.AddItem "1st"
drp.AddItem "2nd"
drp.AddItem "3rd"
drp.AddItem "4th"
drp.AddItem "5th"
Next

End Sub
Sub ClearDropDown()
'clear list set with listfillrange or additem
Dim drp As DropDown
For Each drp In ActiveSheet.DropDowns
drp.RemoveAllItems
Next

End Sub

Sub SetListFill()
Dim drp As DropDown
For Each drp In ActiveSheet.DropDowns
drp.ListFillRange = ActiveSheet. _
Range("A1:A10").Address(external:=True)
Next

End Sub


--
Regards,
Tom Ogilvy
"Tom Ogilvy" wrote in message
...
Dim drp as Dropdown
for each drp in activeSheet.Dropdowns
drp.ListFillRange = ""
Next


--
Regards,
Tom Ogilvy


josh ashcraft wrote in message
...
attn: Tom Oglivy or anyone else who may be able to help...

I need help Clearing the list from all form commandboxes
on my worksheet, the code I had earlier didn't seem to
work correctly, or I was using it wrong, could someone
please help me with this?
Thanks in advance,
Josh





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
Clearing the autocomplete list in a cell Mike K Excel Discussion (Misc queries) 1 June 12th 07 12:37 PM
Clearing files in list that no longer exist OpaRon Excel Discussion (Misc queries) 6 January 2nd 07 10:37 PM
clearing blanks in drop-down list Richard Walker Excel Discussion (Misc queries) 1 May 22nd 06 11:56 PM
Clearing the Values in a Drop - Down List Sagu Excel Discussion (Misc queries) 4 March 31st 06 03:32 AM
Clearing List Boxes Kevin Willhoit Excel Discussion (Misc queries) 2 June 17th 05 08:03 PM


All times are GMT +1. The time now is 07:26 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"