Ok guys I haven't fooled with stuff like this in 10 years so any help is appreciated.
I have a spreadsheet where I created a button and macro to make a new worksheet. The name of the new sheet is based off of a cell T6 where the date is. If the date is changed it works flawlessly but this spreadsheet will be used many times a day. When you keep the same date it errors saying "Cannot rename a sheet to the same name as another" is there a way to put a value of A, B, C and so on for that date? I also need to create a "next number" off of cell T7 what will go there will be 2013MT1 the next should be 2013MT2 all this on one button would be sweet. Here is the code I have so far, I know it isn't a lot but I am just starting this again.
Thanks in Advance.
Sub AssignPageName()
Dim NextPageName As String
' Do whatever stuff you need to do on your existing/current sheet here...
NextPageName = Worksheets(ActiveSheet.Name).Range("T6")
Worksheets(ActiveSheet.Name).Select
ActiveSheet.Copy After:=ActiveSheet
ActiveSheet.Name = NextPageName
End Sub
Bookmarks