Tim,
If you use the method to manually set a TestMode variable to true
you can easily switch between the two modes.
When working on "live" workbooks I usually use it in the following way:
Sub TestMe()
' code that I know works
End Sub
If I'm trying to modify or enhance the code I do this with that same
module:
Sub TestMe()
If TestMode = False Then
' code that I know works
Else
' modified code that I'm testing
End If
End Sub
Whenever I'm working on the workbook, I can set TestMode to True
and do whatever I want with it. Since I have to manually set it to test,
I never have to worry about the user running into my untested code
and I can test it as a regular user myself.
When I'm happy that everything works well, I just delete the if statements
and my old code.
I do the same for UserForms too.
Place a button on the form to test some code, but set the button
invisible IF TestMode = False.
With the above method, whenever I have to release the workbook for someone
else to use it, I don't have to worry about what I may heve left in there
or was in the middle of when I save and close it.
John