ExcelBanter

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

aiyer[_3_]

Renaming worksheets!
 
Hello all!

I was trying to ADD & INSERT a worksheet to the existing worksheets
in a workbook and then rename the most currently added (ACTIV
WORKSHEET) to "FEV". How could I generalize the VB code for an
sheetname? Sometimes "sheet2" gets added/inserted to the existin
sheets and sometimes "sheet3" gets added unless we close th
workbook.....

Any suggestions would be greatly appreciated guys and that would b
help.

Thanks,
Arun.
Engr, Vextec

--
Message posted from http://www.ExcelForum.com


Ken Wright

Renaming worksheets!
 
Set NewSh = Worksheets.Add
NewSh.Name = "FEV"

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"aiyer " wrote in message
...
Hello all!

I was trying to ADD & INSERT a worksheet to the existing worksheets,
in a workbook and then rename the most currently added (ACTIVE
WORKSHEET) to "FEV". How could I generalize the VB code for any
sheetname? Sometimes "sheet2" gets added/inserted to the existing
sheets and sometimes "sheet3" gets added unless we close the
workbook.....

Any suggestions would be greatly appreciated guys and that would be
help.

Thanks,
Arun.
Engr, Vextec.


---
Message posted from http://www.ExcelForum.com/



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.592 / Virus Database: 375 - Release Date: 18/02/2004



JE McGimpsey

Renaming worksheets!
 
One way:

Worksheets.Add(After:=ActiveSheet).Name = "FEV"



In article ,
aiyer wrote:

Hello all!

I was trying to ADD & INSERT a worksheet to the existing worksheets,
in a workbook and then rename the most currently added (ACTIVE
WORKSHEET) to "FEV". How could I generalize the VB code for any
sheetname? Sometimes "sheet2" gets added/inserted to the existing
sheets and sometimes "sheet3" gets added unless we close the
workbook.....

Any suggestions would be greatly appreciated guys and that would be
help.


[email protected]

Renaming worksheets!
 
Dim wShtNew As Worksheet
Set wShtNew = Sheets.Add(After:=Sheets(Sheets.Count))
wShtNew.Name = "YourSheetName"

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Hello all!

I was trying to ADD & INSERT a worksheet to the existing worksheets,
in a workbook and then rename the most currently added (ACTIVE
WORKSHEET) to "FEV". How could I generalize the VB code for any
sheetname? Sometimes "sheet2" gets added/inserted to the existing
sheets and sometimes "sheet3" gets added unless we close the
workbook.....

Any suggestions would be greatly appreciated guys and that would be
help.

Thanks,
Arun.
Engr, Vextec.




All times are GMT +1. The time now is 07:21 PM.

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