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

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?
 
G

GTVT06

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
 

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

Top