View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Iterating through a ComboBox's values

kittronald formulated the question :
Garry,

Thanks for the quick response.

I'm putting together an automated routine that goes something like this:

Sub Macro_Automate()
Dim i As Integer
With Sheets("Settings").ComboBox2
For i = 0 To .ListCount - 1: Debug.Print .List(i):
********* Set "Data_Type" name to the text value equal to the current
ComboBox2 i position *********
Macro_Change_Function
Macro_Export_Output
Next 'i
End With
End Sub


How can I get the named range "Data_Type" to be set before
Macro_Change_Function runs ?




- Ronald K.


You're welcome!

Try this...

Sub Macro_Automate()
Dim i As Integer
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
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc