I'll take a little issue with Rob's suggestion. Using GoTo statements for anything other than error handling make code hard to follow, debug, and maintain, and VBA has a wealth of flow control structures to choose from to avoid them. For example,
Code:
For i = 1 To 10
If cond1 Then
' do this
ElseIf cond2 Then
' do that
Else
' do the other thing
End If
Next i
__________________
Entia non sunt multiplicanda sine necessitate.
Last edited by shg; 01-10-2009 at 09:32 PM.
|