Dim MyDate
Dim MyMonth
...declares two new variables, for use later...
MyDate = Date
...assigns the current date into the variable MyDate...
MyMonth = Month(MyDate)
...takes the month, as an integer (whole number) value, from MyDate, and places the value in MyMonth...
ThisWorkbook.SaveAs Filename:="Taxi-2-Go - " & MonthName(MyMonth) & Year(Date)
... saves ThisWorkbook as the concatenated file name as stated, ie. take the string "Taxi-2-Go" and append the name of the month (of which the numeric value is in MyMonth, eg. 11=november), and also append the year of the current date...
End Sub
...ends the procedure, this is paired with the statement...
Sub MyProcedure()
...that you have missed out in your cut & paste but should come at the beginning of the code.. This same code can be done in one statement, as follows...
Sub MyRoutine()
ThisWorkbook.SaveAs Filename:="Taxi-2-Go - " & MonthName(Month(Date)) & Year(Date)
End Sub
...and you can play with it for differing results, for example if you want to insert a space in between the month and the year you would use the following...
Sub MyRoutine()
ThisWorkbook.SaveAs Filename:="Taxi-2-Go - " & MonthName(Month(Date)) & " " & Year(Date)
End Sub
...good luck, don't be afraid to get stuck in and make changes to these things.
_________________<table style="background-color:#0e54be" cellspacing="1" cellpadding="2"><td style="background-color:#ceffff;font-family:arial;color:#072c63;font-size:8pt;"> DALEY :P </td></table>
This message was edited by daleyman on 2002-04-14 07:34