Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using this code to fill a combobox list. However, somehow the values are
getting added onto previous values and the range is not emptying before it adds items. How do I fix this. Dim thiscel As Range ComboBox1.ListFillRange = "" For Each thiscel In Sheets("Defaults").Range("R344:R362") If Len(thiscel) 0 Then Sheets("Input").ComboBox1.AddItem thiscel.Value End If Next |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Add this line of code...
ComboBox1.Clear To clear any previous additions to the combo box. -- HTH... Jim Thomlinson "Cody" wrote: I am using this code to fill a combobox list. However, somehow the values are getting added onto previous values and the range is not emptying before it adds items. How do I fix this. Dim thiscel As Range ComboBox1.ListFillRange = "" For Each thiscel In Sheets("Defaults").Range("R344:R362") If Len(thiscel) 0 Then Sheets("Input").ComboBox1.AddItem thiscel.Value End If Next |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Jim. I have been racking my brain of such a simple fix.
"Jim Thomlinson" wrote: Add this line of code... ComboBox1.Clear To clear any previous additions to the combo box. -- HTH... Jim Thomlinson "Cody" wrote: I am using this code to fill a combobox list. However, somehow the values are getting added onto previous values and the range is not emptying before it adds items. How do I fix this. Dim thiscel As Range ComboBox1.ListFillRange = "" For Each thiscel In Sheets("Defaults").Range("R344:R362") If Len(thiscel) 0 Then Sheets("Input").ComboBox1.AddItem thiscel.Value End If Next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |