inserting and renaming a sheet vba

  • Thread starter Thread starter Matt Houston
  • Start date Start date
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
 
Something like this:
Sub AddNameTab()
Dim CurrSht As Integer
CurrSht = ActiveSheet.Index
Worksheets.Add After:=Worksheets(CurrSht)
ActiveSheet.Name = "MyNewSheet"
End Sub

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top