You guys are terrific. So much help in only a couple of hours.
First, Norie: The code is written this way because there are (or will be) many other subroutines which use the global variables. Your code using With statement in the "Define_Variables()" is cleaner. Also it works without crashing BUT trying both IntextRange.Delete or IntextRange.ClearContents has no effect on the spreadsheet.
Other questions: the Sub Define_Variables is always run first. No sheets are hidden.
If I may impose on your kindness, let me explain a bit more about the project:
It begins by importing a text file into the spreadsheet; then goes on to make several calculations. When this finishes and results are saved, I wish to repeat the process with another text file, BUT: A connection has already been established and this connection must be terminated before I can import another text file into the same space. I have managed to accomplish this with the following macro, but it won't work when I try to use the macro code in a VBA module.
So again, thanks and any additional help greatly appreciated.
Bookmarks