vb script to add names to tabs

  • Thread starter Thread starter mark.beckwith
  • Start date Start date
M

mark.beckwith

I am trying to set up a looping macro that will fill a
template with information and then change the name of the
tab to a name in a list. Does anyone know how to write the
visual basic script to add to a macro?

Thanks
 
Try something like this.
It adds the tabs then renames the tabs to the names in cells (A:4) to cells
(A:4+n).


Private Sub CommandButton1_Click()

x = 4
Do While Sheet1.Range("A" & x) <> ""
Sheets("Sheet3").Select
Sheets.Add
Sheets("Sheet" & x).Name = "Whatever" & x
x = x + 1
Loop

End Sub
 
Back
Top