Iterating through a ComboBox's values
On Oct 21, 6:41*pm, "kittronald" wrote:
* * I'm using a macro that iterates through a ComboBox's values and runs two
macros during each pass.
* * However, the iteration doesn't appear to actually select the ComboBox's
values on the worksheet.
* * This is a problem because one of the macros depends on the ComboBox's
linked cell value to change.
* * For example:
* * * * With Sheets("Settings").ComboBox2
* * * * * * For i = 0 To .ListCount - 1
* * * * * * Sheets("Settings").Range("Data_Type") = .List(i)
* * * * * * Call Macro_Change_Function: Macro_Export_Output
* * * * * * Next 'i
* * * * End With
* * How can I get this code to actually select the ComboBox's value so its
linked cell's value changes before the macros execute.
- Ronald K.
Change your macros so that they accept an input argument, such as
Macro1(X as variant)
Then call your macro using the value of List(i)
|