ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page x of y (https://www.excelbanter.com/excel-programming/363729-page-x-y.html)

Henrik

Page x of y
 
Hi,

I have a macro with the following patch of code (except for the stuff in the
bracket).
However, I want the code to insert page x of y into the right footer. I
figure it will go where the bracket is, but I am not certain how to program
this. Your help is much appreciated.

If Range("c_pageswitch") = True Then
Worksheets(ws_name).PageSetup.RightFooter = [x of y]
Else
Worksheets(ws_name).PageSetup.RightFooter = ""
End If

Ardus Petus

Page x of y
 
Worksheets(ws_name).PageSetup.RightFooter = "&P of &N"

HTH
--
AP

"Henrik" a écrit dans le message de news:
...
Hi,

I have a macro with the following patch of code (except for the stuff in
the
bracket).
However, I want the code to insert page x of y into the right footer. I
figure it will go where the bracket is, but I am not certain how to
program
this. Your help is much appreciated.

If Range("c_pageswitch") = True Then
Worksheets(ws_name).PageSetup.RightFooter = [x of y]
Else
Worksheets(ws_name).PageSetup.RightFooter = ""
End If





All times are GMT +1. The time now is 09:17 PM.

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