ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Renaming a Worksheet with a macro... but... (https://www.excelbanter.com/excel-programming/307601-renaming-worksheet-macro-but.html)

Pitbull at Work

Renaming a Worksheet with a macro... but...
 
Hello all, I am trying to rename a sheet in a macro but I
want the sheet name to be taken in a specific cell.

For example, I have "Hello: in cell a1 and want my macro
to create a new worksheet and name it "hello" (hello might
change to something else)

How can I do that?

Thanks

Pitbull

Chip Pearson

Renaming a Worksheet with a macro... but...
 
Try something like


Worksheets.Add.Name = Worksheets("Sheet1").Range("A1").Text


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Pitbull at Work" wrote in
message ...
Hello all, I am trying to rename a sheet in a macro but I
want the sheet name to be taken in a specific cell.

For example, I have "Hello: in cell a1 and want my macro
to create a new worksheet and name it "hello" (hello might
change to something else)

How can I do that?

Thanks

Pitbull





All times are GMT +1. The time now is 09:14 AM.

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