This worked. I did have trouble finding a way to get out of my nestsed FOR loops. I ended up using this code:
If DoEvents <> 1 Then
myRowIterator = (myRowCountStop + 1)
Else
myRowIterator = myRowIterator + 1
End If
As you can see, I set the iterator to a high value to get out of the loop. I was intending to use something nicer such as a DO..WHILE with a boolean variable, but couldn't get that to work. Does anyone have a better example? At any rate, I DID get this to work using the DoEvents so I'll accept the answer. Thanks!!! Just comment on this if you have any better suggestions.
Main Topics
Browse All Topics





by: zorvekPosted on 2006-10-10 at 16:44:07ID: 17703269
You need to periodically call DoEvents to give Excel an opportunity to handle clicks. Then in the user form Cancel button click handler set a module level variable indicating that cancel has been clicked. In your function monitor the variable and exit if set.
Kevin