ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   new worksheet and rename from cell contents macro (https://www.excelbanter.com/excel-worksheet-functions/109493-new-worksheet-rename-cell-contents-macro.html)

Henry

new worksheet and rename from cell contents macro
 
Hi all,

I need a macro to:

Copy the latest worksheet, (not a specific one each time)
Rename the worksheet to the contents of a cell (i.e. a date)


Any help with code?

Allllen

new worksheet and rename from cell contents macro
 
This should start you off in the right direction.
Tell me what you don't like about it and we will go from there.

Sub TryThis()

Sheets(Sheets.Count).Copy After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = Sheets(Sheets.Count).Range("A1").Value

End Sub
--
Allllen


"henry" wrote:

Hi all,

I need a macro to:

Copy the latest worksheet, (not a specific one each time)
Rename the worksheet to the contents of a cell (i.e. a date)


Any help with code?



All times are GMT +1. The time now is 11:29 AM.

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