Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Renaming worksheets | Excel Discussion (Misc queries) | |||
Renaming worksheets | Excel Worksheet Functions | |||
RENAMING WORKSHEETS | Excel Worksheet Functions | |||
Renaming worksheets | Excel Discussion (Misc queries) | |||
Renaming Worksheets | Excel Worksheet Functions |