⟩ I use a large spreadsheet on a daily basis with 31 worksheets (one for each day of the month). Each worksheet is huge.I would like to insert another sheet in the workbook and insert a button to copy another worksheet to the end of the workbook and then rename the sheet to the correspondingday of the month?
If you worksheet names are numeric, this will do the trick:
Public Sub CopyIt()
' This macro will only work if your sheet names are numeric
' Example: the sheet for the first day is 1
'
' Count how many sheets are in this workbook
LastSheet = ActiveWorkbook.Sheets.Count
' What is the name of the last sheet?
LastName = ActiveWorkbook.Sheets(LastSheet).Name
' Add one to the last name to get the new name
NewName = LastName + 1
' Make a Copy of the last sheet
ActiveWorkbook.Sheets(LastSheet).Copy after:=Worksheets(LastName)
'Rename the sheet for today
NewLast = LastSheet + 1
ActiveWorkbook.Sheets(NewLast).Name = NewName
End Sub