suthern_gntlman
New Member
- Joined
- Feb 17, 2010
- Messages
- 9
A commandbutton copies Daily Lab.xlsm and saves it into a dir, based upon a Date in a certain cell. (used a code from MrExcel forums) It Works great, btw....
Ex: Daily Lab.xlsm has a date in "C6" of 2/23/2010. It saves it into the Daily Lab\2010\FEB dir, as Feb232010.xlsm (creates dir when month and year changes)
The macro I created then clears all data from Daily Lab.xlsm, saves and closes it. When the LabTech opens it up all data (including previous date) must be gone. I used the following code to accomplish this:
In ThisWorkBook:
My Problem: I need the macro to stay in Feb232010.xlsm for other reasons.
Unknown solution: I would like to use an "If Then" in ThisWorkBook that upon opening will look at the Date in "C6" and compare it to the name of the WorkBook. If they equal then the date stays, if they don't equal the date clears.
I'm able to understand what code does once I see it, but having a real hard time creating it from scratch...
Thanks in advance...
Ex: Daily Lab.xlsm has a date in "C6" of 2/23/2010. It saves it into the Daily Lab\2010\FEB dir, as Feb232010.xlsm (creates dir when month and year changes)
The macro I created then clears all data from Daily Lab.xlsm, saves and closes it. When the LabTech opens it up all data (including previous date) must be gone. I used the following code to accomplish this:
In ThisWorkBook:
Code:
Private Sub Workbook_Open()
'CLEARS DATE FOR FRESH DATA ENTRY
Range("C6").Select
Selection.ClearContents
End Sub
Unknown solution: I would like to use an "If Then" in ThisWorkBook that upon opening will look at the Date in "C6" and compare it to the name of the WorkBook. If they equal then the date stays, if they don't equal the date clears.
I'm able to understand what code does once I see it, but having a real hard time creating it from scratch...
Thanks in advance...