ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing previous page (https://www.excelbanter.com/excel-programming/328484-accessing-previous-page.html)

James Agostinho

Accessing previous page
 
Hello NG,
I'm having a problem accessing the previous page from code.
By that I mean every couple of days or once a week I add a page, through a
macro, and then I need to go to the previous page (different name every
time) and copy everything in the E column and then return to the last page
(also different name every time) and paste the copied numbers in Column I.

I know how to get the page count but I don't know how to use the count after
I get it.
Any suggestions please.
TIA
James



Vasant Nanavati

Accessing previous page
 
Previous page:

Worksheets(ActiveSheet.Index - 1)

Last page:

Worksheet(Worksheets.Count)

--

Vasant



"James Agostinho" wrote in message
ink.net...
Hello NG,
I'm having a problem accessing the previous page from code.
By that I mean every couple of days or once a week I add a page, through a
macro, and then I need to go to the previous page (different name every
time) and copy everything in the E column and then return to the last page
(also different name every time) and paste the copied numbers in Column I.

I know how to get the page count but I don't know how to use the count

after
I get it.
Any suggestions please.
TIA
James





Bob Phillips[_6_]

Accessing previous page
 


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Previous page:

Worksheets(ActiveSheet.Index - 1)


or activesheet.previous.select



James[_38_]

Accessing previous page
 
Thanks, it seems too simply, but works great for what I want.
James



"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Previous page:

Worksheets(ActiveSheet.Index - 1)

Last page:

Worksheet(Worksheets.Count)

--

Vasant



"James Agostinho" wrote in message
ink.net...
Hello NG,
I'm having a problem accessing the previous page from code.
By that I mean every couple of days or once a week I add a page, through
a
macro, and then I need to go to the previous page (different name every
time) and copy everything in the E column and then return to the last
page
(also different name every time) and paste the copied numbers in Column
I.

I know how to get the page count but I don't know how to use the count

after
I get it.
Any suggestions please.
TIA
James








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

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