A condition and a variable
First question: This code will test if the file ABCD.xls exists in the
c:\2009 directory and, if it does, exit the subroutine right then and
there...
If Len(Dir("C\2009\ABCD.xls")) 0 Then Exit Sub
Second question: I not exactly sure how to read what you want here. I mean,
assignment to variables is kind of basic, for example...
TextVariable = "I am some text"
so I'm thinking maybe your question is not complete. Can you give us more
detail and an example?
Rick
"Berj" wrote in message
...
I want to use a command or two in a macro in Excel where it checks for the
existence of a file "ABCD" in folder C:\2009. If the file exists, then it
should close the active file without saving. Otherwise if the file doesn't
exist in continues the execution of the rest of the macro lines.
Another question:
How can I assign a text value in a variable?
|