Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys
I have a userform. On the form is combobox4. I have a change event for the combobox and a drpdownclick event for the combobox. Below is the code in the dropdown event: ComboBox4.Clear ComboBox4.AddItem "Select File to Publish" ComboBox4.AddItem "All Files" Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(TextBox16.Value) Set fc = f.Files For Each f1 In fc ComboBox4.AddItem f1.Name ' s = s & f1.Name ' s = s & vbCrLf Next ' MsgBox s This code populates the dropdown box with values. When I select a value the combobox change event then runs. This is where the problem happens. Instead of running ONLY the combobox change event, after it runs it, it then goes back to the dropdownbutton click event and runs that. Because it runs it again, it clears out what I just selected in the combobox. Then the code quits and leaves me with an empty combobox. How do I fix this? Todd |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping | Excel Discussion (Misc queries) | |||
stopping code from looping | Excel Worksheet Functions | |||
Looping macros using VB code | Excel Discussion (Misc queries) | |||
"Looping" Code | Excel Programming | |||
VBA code for looping through open workbooks and worksheets | Excel Programming |