View Single Post
  #12  
Old 01-10-2009, 08:50 PM
mudraker's Avatar
mudraker mudraker is offline
Forum Moderator
 
Join Date: 10 Nov 2003
Location: Melbourne, Australia
Posts: 4,235
mudraker has an addiction to Excel
I agree with shg that it is best to avoid using Goto's except for error handling

Another option is to built several smaller macros that each do part of what you require and call them from a main macro

Using shg code as an example
Code:
    For i = 1 To 10
        If cond1 Then
            call macro1
        ElseIf cond2 Then
            call macro2
        Else
          call macro3
        End If
       if newCondTest then
          call macro4
       end if
    End If
__________________
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely

Top Excel links for beginners to Experts

If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assisted or failed to assist you I welcome your Feedback.
Reply With Quote