ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a new worksheet and naming it according to a specific cel (https://www.excelbanter.com/excel-programming/412794-creating-new-worksheet-naming-according-specific-cel.html)

Surfbreakn2000

Creating a new worksheet and naming it according to a specific cel
 
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?

GTVT06

Creating a new worksheet and naming it according to a specificcel
 
On Jun 18, 9:05*pm, Surfbreakn2000
wrote:
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


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com