Hi I am using the following code to rename a new sheet that gets created when the workbook is opened.
Can anyone help me add code to format the Year as only 2 digits not 4, thanks.
Thanks Dan
Can anyone help me add code to format the Year as only 2 digits not 4, thanks.
VBA Code:
Dim iMonth As Integer, sMonth As String
Dim sYear As String
iYear = Year(Now)
iMonth = Month(Now) - 1
Select Case iMonth
Case 1
sMonth = "Jan"
Case 2
sMonth = "Feb"
Case 3
sMonth = "Mar"
Case 4
sMonth = "Apr"
Case 5
sMonth = "May"
Case 6
sMonth = "Jun"
Case 7
sMonth = "Jul"
Case 8
sMonth = "Aug"
Case 9
sMonth = "Sep"
Case 10
sMonth = "Oct"
Case 11
sMonth = "Nov"
Case 10
sMonth = "Dec"
End Select
Worksheets(1).Name = sMonth & "_" & iYear
Thanks Dan