1

I see how to add a tab for a macro with a date stamp but I have not been able to figure out how to also add a label to it as well. As an example I would like to be able to create a tab that says Dec-2016 Journal or Dec-2016 Log

H Jennings
  • 11
  • 2

2 Answers2

0

Use this as a starting base

Option Explicit
Sub addsheet()

Sheets.Add
ActiveSheet.Name = "Insert Name"

End Sub

Do you need it to be self-allocating with respect to date/name etc?

mojo3340
  • 534
  • 1
  • 6
  • 27
0

Try this, This will add the sheet and name it with a date log. I have put in more info on the date, as it could cause a conflict with same names for the sheet by making a new sheet in the same month

sName = "My Sheet"
With ThisWorkbook
   .Sheets.Add(After:=.Sheets(.Sheets.Count)).Name = _
       sName & " " & Format(Now(), "mmm-yyyy hh-mm-ss")
End With

You can change the formatting to suit your needs. And if you don't need hours , minutes and seconds, just remove that from the formatting code.

KyloRen
  • 2,691
  • 5
  • 29
  • 59