Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Combo Box to display a blank
I have a combo box on a user form. I have set the Row source as =list!a1:a5.
However when I display the form the value displayed in the combo box is the one from the previous record. How do I get it to clear and show a blank each time? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Combo Box to display a blank
Comboboxes remember their last settings. You have to initialize tthe box
before the .SHOW to change the settings. "sot" wrote: I have a combo box on a user form. I have set the Row source as =list!a1:a5. However when I display the form the value displayed in the combo box is the one from the previous record. How do I get it to clear and show a blank each time? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Combo Box to display a blank
Thanks. Could you help me with that please. I don't have the knowledge.
This is what I have so far: Sub Button1_Click() Range("B3").Value = Worksheets("table").Range("A20000").End(xlUp).Row Range("C1").Value = "" Range("D1").Value = 0 Range("E1").Value = Format(Date, "dd/MM/yy") myform.Show myform.fname.SetFocus End Sub "Joel" wrote: Comboboxes remember their last settings. You have to initialize tthe box before the .SHOW to change the settings. "sot" wrote: I have a combo box on a user form. I have set the Row source as =list!a1:a5. However when I display the form the value displayed in the combo box is the one from the previous record. How do I get it to clear and show a blank each time? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Combo Box to display a blank
myform.ComboBox1.ListIndex = -1
myform.Show -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "sot" wrote in message ... Thanks. Could you help me with that please. I don't have the knowledge. This is what I have so far: Sub Button1_Click() Range("B3").Value = Worksheets("table").Range("A20000").End(xlUp).Row Range("C1").Value = "" Range("D1").Value = 0 Range("E1").Value = Format(Date, "dd/MM/yy") myform.Show myform.fname.SetFocus End Sub "Joel" wrote: Comboboxes remember their last settings. You have to initialize tthe box before the .SHOW to change the settings. "sot" wrote: I have a combo box on a user form. I have set the Row source as =list!a1:a5. However when I display the form the value displayed in the combo box is the one from the previous record. How do I get it to clear and show a blank each time? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Combo Box to display a blank
If you want to be able to select the same selection as previously selected then
Private Sub ListBox1_MouseDown(ByVal Button As _ Integer, ByVal Shift As Integer, ByVal X As Single, _ ByVal Y As Single) Listbox1.Listindex = -1 End Sub this won't visibly clear the selection if you are issuing a show command after a hide. for that, you would need to issue the same command in the useform_activate event I would suspect. or better yet, issue it just before the show command myform.ListBox1.ListIndex = -1 myform.Show -- Regards, Tom Ogilvy "sot" wrote: Thanks. Could you help me with that please. I don't have the knowledge. This is what I have so far: Sub Button1_Click() Range("B3").Value = Worksheets("table").Range("A20000").End(xlUp).Row Range("C1").Value = "" Range("D1").Value = 0 Range("E1").Value = Format(Date, "dd/MM/yy") myform.Show myform.fname.SetFocus End Sub "Joel" wrote: Comboboxes remember their last settings. You have to initialize tthe box before the .SHOW to change the settings. "sot" wrote: I have a combo box on a user form. I have set the Row source as =list!a1:a5. However when I display the form the value displayed in the combo box is the one from the previous record. How do I get it to clear and show a blank each time? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Average Formula to display blank cell if named range is blank | Excel Worksheet Functions | |||
Setting default value for combo box | Excel Programming | |||
how to get excel to display blank if reference cell blank | Excel Worksheet Functions | |||
setting up drop down combo box with VBA | Excel Programming | |||
Setting the value of a cell from a combo box | Excel Programming |