Creating a new worksheet and naming it according to a specific cel

  • Thread starter Thread starter Surfbreakn2000
  • Start date Start date
S

Surfbreakn2000

Hey I'm trying to create a scipt that will creat a new worksheet and name
that new worksheet according to a cell in a particular other worksheet. Or I
would like it to name it according to what the selected cell is before the
macro runs. How can I do this?
 
Hey I'm trying to create a scipt that will creat a new worksheet and name
that new worksheet according to a cell in a particular other worksheet. Or I
would like it to name it according to what the selected cell is before the
macro runs. How can I do this?

hello,

This code will create a new sheet and name it based off the cell A1
value in "Sheet1"
Worksheets.Add(After:=Sheets(Sheets.Count)).Name =
Worksheets("Sheet1").Range("A1").Value

This code will create a new sheet and name it based off the value in
the active cell
Worksheets.Add(After:=Sheets(Sheets.Count)).Name = ActiveCell.Value
 
Back
Top