Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lookup with multiple condition, but one condition to satisfy is en | Excel Worksheet Functions | |||
Combine an OR condition with an AND condition | Excel Discussion (Misc queries) | |||
Condition 1 overules condition 2? | Excel Worksheet Functions | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
I need 4 condition for condition formatting | Excel Programming |