I have the following code to to a Save As action on a file:
This is used to archive a file every day with the date, however, I'd like the name to bein the format
ALWAYS, but, say for example on the first of march, the file name will be
. How can I change the above code so that the values in the three cells are always two digits?
Code:
Range("A3").Select
Range("A1").Formula = Now()
Range("B1").FormulaR1C1 = "=DAY(RC[-1])"
Range("C1").FormulaR1C1 = "=MONTH(RC[-2])"
Range("D1").FormulaR1C1 = "=YEAR(RC[-3])"
MyDay = Range("B1").Value
MyMonth = Range("C1").Value
MyYear = Range("D1").Value
This is used to archive a file every day with the date, however, I'd like the name to bein the format
Code:
MyFileName MM-DD-YY.xls
Code:
MyFileName M-D-YY.xls