Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
Can anyone know the way to set a ListBox(Form) empty.
With the TextBox and Combox the Text property can read and write. But with the ListBox i think it only can read? Is there any way? --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
Is this something that you want ... ? This initialises a 2 column lis
box :- '- initialise form Private Sub UserForm_Initialize() Set DataSheet = ThisWorkbook.Worksheets("data") Set MyList = DataSheet.Range("FileList") Rw = 1 FileListBox.Clear While MyList.Cells(Rw, 1).Value < "" FileListBox.AddItem FileListBox.List(Rw - 1, 0) = MyList.Cells(Rw, 1).Value FileListBox.List(Rw - 1, 1) = MyList.Cells(Rw, 2).Value Rw = Rw + 1 Wend End Su -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
Did you want to unselect any selected items, or did you want to remove
all the items showing in the listbox? If the former, just use ListBox1.ListIndex = -1 If the latter, does your listbox have a rowsource, or is it populated with AddItem? -- HTH, Dianne Can anyone know the way to set a ListBox(Form) empty. With the TextBox and Combox the Text property can read and write. But with the ListBox i think it only can read? Is there any way? --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
What I mean is:
If I have a listbox1 which has a property List Range: A1:A3 A1=""; A2="1"; A3="2"; for example; The list box I resize it into one row(Which will has up and dow buttons). Assume I used down button to choose the value 2(A3). How can I set listbox1 appear blank. I can use: ListBox1.ListIndex = 0; But it only affect when the ListBox1 is selected! Help me -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
Listbox.ListIndex = -1
Listbox.TopIndex = 0 would show what is in cell A1 (which is blank). I believe that is what you mean. -- Regards, Tom Ogilvy bookworm98 wrote in message ... What I mean is: If I have a listbox1 which has a property List Range: A1:A3 A1=""; A2="1"; A3="2"; for example; The list box I resize it into one row(Which will has up and down buttons). Assume I used down button to choose the value 2(A3). How can I set listbox1 appear blank. I can use: ListBox1.ListIndex = 0; But it only affect when the ListBox1 is selected! Help me! --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Clear value a listbox!
Thanks Tom,
ListBox.TopIndex = 0 What all I need! BEST WISHES, Tom Ogilvy wrote: *Listbox.ListIndex = -1 Listbox.TopIndex = 0 would show what is in cell A1 (which is blank). I believe that is what you mean. -- Regards, Tom Ogilvy bookworm98 wrote in message ... What I mean is: If I have a listbox1 which has a property List Range: A1:A3 A1=""; A2="1"; A3="2"; for example; The list box I resize it into one row(Which will has up and down buttons). Assume I used down button to choose the value 2(A3). How can I set listbox1 appear blank. I can use: ListBox1.ListIndex = 0; But it only affect when the ListBox1 is selected! Help me! --- Message posted from http://www.ExcelForum.com/ * --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transfer a name from one cell to another but leave clear if clear? | Excel Worksheet Functions | |||
clear the clear the web page email attachment lines | Excel Discussion (Misc queries) | |||
listbox B conditional of input in Listbox A | Excel Discussion (Misc queries) | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming |