inserting and renaming a sheet vba

M

Matt Houston

actually, if I already have one sheet, is there a way I can insert a ne
sheet to the right of it and name the new sheet in one line of code
 
J

Jim May

Something like this:
Sub AddNameTab()
Dim CurrSht As Integer
CurrSht = ActiveSheet.Index
Worksheets.Add After:=Worksheets(CurrSht)
ActiveSheet.Name = "MyNewSheet"
End Sub

HTH
 
Top