Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clearing the autocomplete list in a cell | Excel Discussion (Misc queries) | |||
Clearing files in list that no longer exist | Excel Discussion (Misc queries) | |||
clearing blanks in drop-down list | Excel Discussion (Misc queries) | |||
Clearing the Values in a Drop - Down List | Excel Discussion (Misc queries) | |||
Clearing List Boxes | Excel Discussion (Misc queries) |