LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Iterating through a ComboBox's values

kittronald presented the following explanation :
Garry,

Hey, that works very nice !

So using CALL allows you to run macros in serial fashion and the colon
acts as a multi-value delimiter.

This is a real time saver as I can now walk away for a few hours instead
of having to babysit this workbook and manually run each iteration of the
macro every 40 minutes.

Thanks again !



- Ronald K.


Ron,
You're welcome, ..again!<g

Just to be clear, the 'Call' statement is well defined in the online
help but I used it here because of the colon I used to separate the
executables. Thus, the colon is a line-delimiter...

Without colon:
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

With colon:
Sub Macro_Automate()
Dim i As Integer
With Sheets("Settings").ComboBox2
For i = 0 To .ListCount - 1
Sheets("Settings").Range("Data_Type") = .List(i):
Macro_Change_Function: Macro_Export_Output
Next 'i
End With
End Sub

**Note here that the 'Call' statement is not used AND the single line
wraps here. In an effort to make it NOT wrap in the viewer I had to put
the wrapped line (calls to 2 macros) as a separate line. Because these
calls were separated by the colon, I had to use 'Call' so VB[A]
wouldn't interpret the first call as a label. This would have happened
because of the macro name[s] being treated as a single word.

--
Garry

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iterating through cells, comparing values kingpin2502 Excel Programming 0 July 11th 05 06:08 PM
Offset & Combobox's returned Value Anat Sn Excel Programming 1 December 25th 03 03:57 PM
Referring to OLEObjects (combobox's on worksheet) Ian Chappel[_2_] Excel Programming 4 September 22nd 03 05:31 PM
checking for errors in combobox's Bob C[_2_] Excel Programming 1 September 4th 03 09:03 PM


All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"