ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   determening sheet number (https://www.excelbanter.com/excel-programming/328781-determening-sheet-number.html)

Mark Kubicki

determening sheet number
 
after command: Sheets.Add
is there a simple way of determining the number of the sheet just added?

-as always, thanks in advance
mark



keepITcool

determening sheet number
 

when you add a sheet it's autom. activated..
the "number" is given by the Index property

Activesheet.Index

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


mark kubicki wrote :

after command: Sheets.Add
is there a simple way of determining the number of the sheet just
added?

-as always, thanks in advance
mark


Bob Phillips[_7_]

determening sheet number
 
You could always do

Woksheets.Add.Name ="mySheet"

and you have its name

--
HTH

Bob Phillips

"mark kubicki" wrote in message
...
after command: Sheets.Add
is there a simple way of determining the number of the sheet just added?

-as always, thanks in advance
mark





zackb[_2_]

determening sheet number
 
Hi Mark,

You can also specify where you add the sheet so you already know the
position. And I have a hinkering that this delves deeper than just knowing
the Index of the sheet. Am I right?

Anyway, examples ...

Add a sheet as the first sheet:
Sheets.Add befo=Sheets(1)

Add a sheet as the last sheet:
Sheets.Add after:=Sheets(Sheets.Count)

HTH
--
Regards,
Zack Barresse, aka firefytr

"mark kubicki" wrote in message
...
after command: Sheets.Add
is there a simple way of determining the number of the sheet just added?

-as always, thanks in advance
mark






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

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