Thread: Page x of y
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ardus Petus Ardus Petus is offline
external usenet poster
 
Posts: 718
Default 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