[Resolved] Simple Excel Request
My code works quite well, the first time it's run. Every subsequent time it screws up.
All I have to do is hit the reset button in the VBA editor to refresh my code, which is fine for me, but the users won't have the knowledge to do that.
Can I add code to make it so that the first or last thing my sub does is the equivalent of hitting that "Reset" button?
What else can I do?
Thanks for your help.
Re: Simple Excel Request [Resolved]
Justin, Rob, Ecniv,
Thanks for all your help, this is my first resolved thread, so hooray!
When I re-examined the code to reply to Justin, I saw the problem I called "strange" above, and investigated....
It turned out that I HAD coded it so that everything would reset like I thought I had, except I had missed resetting one very important value and so I had:
VB Code:
If ImportantVal=0 Then
'Do many important things
End If
'but it never did this after the first run because ImportantVal had a value persisting in it for some reason
'So I added, right at the end
ImportantVal=0
Exit Sub
And now, it doesn't need to be reset in between.
Now, If only I could get my other issue up and running...