ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Renaming worksheets (https://www.excelbanter.com/excel-programming/329547-renaming-worksheets.html)

Greg B[_5_]

Renaming worksheets
 
I want to have a code to copy the worksheet called "invoice" and once it is
copied I want it to change its name to what ever is in cells "G13"

Thanks again

Greg



Darrin Henshaw

Renaming worksheets
 
Something like this should work:

Dim Wname As String
Wname = Worksheets("Sheet1").Range("G13")
Worksheets("Sheet1").Copy after:=Worksheets _(Worksheets.Count)
ActiveSheet.Name = Wname

You don't have to use the "after:=Worksheets _(Worksheets.Count)", all
that does is put the new sheet at the end, you can put it wherever you
want.

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

Renaming worksheets
 
Hi Greg,


ActiveSheet.Copy Befo=Worksheets(Worksheets.Count)
ActiveSheet.Name = Range("G13").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Greg B" wrote in message
...
I want to have a code to copy the worksheet called "invoice" and once it

is
copied I want it to change its name to what ever is in cells "G13"

Thanks again

Greg






All times are GMT +1. The time now is 12:14 PM.

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