different footers macro

L

Linda

The macro in the 7/25/03 post works well to have a
different footer on page 2 and none on page 1. I would
prefer the macro not to print, but to go into print
preview. Can you help? Thanks.
 
D

David McRitchie

Hi Linda,
The thread for your other post can be referenced by:
http://google.com/[email protected]

I supplied an answer there as well for completeness. Wasn't
immediately seen that you still had a question until the words
"can you help", either that or some of us were asleep.

The macro you used is invoked twice in other words there are
two printings: one for page 1 and one for the remainder of
the pages. You cannot simulate this in Print Preview but
you can look at two separate Print Previews.

Instead of
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1
try
ActiveWindow.SelectedSheets..PrintPreview From:=1, To:=1

and the other PrintOut as well.

which was found by recording a macro that did a Print Preview
and substituting the code into the above.
ActiveWindow.SelectedSheets.PrintPreview
 
P

Paul Corrado

Linda,

I can't seem to get David's adjustment to work in the code I had given to
you (I'm somewhat of a novice programmer so that does not necessarily mean
his suggestion is incorrect)

However, I did find that adding "Preview:=True" to the end of the PrintOut
statements will generate a preview for each section. Once you have the
preview open, I believe you should be able to select "Close" and the page(s)
will not print. After previewing the first section and selecting "Close" the
macro will then preview the second selection.

To be clear, the full statement is below.

ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Preview:=True

HTH

PC


David McRitchie said:
Hi Linda,
The thread for your other post can be referenced by:
http://google.com/[email protected]

I supplied an answer there as well for completeness. Wasn't
immediately seen that you still had a question until the words
"can you help", either that or some of us were asleep.

The macro you used is invoked twice in other words there are
two printings: one for page 1 and one for the remainder of
the pages. You cannot simulate this in Print Preview but
you can look at two separate Print Previews.

Instead of
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1
try
ActiveWindow.SelectedSheets..PrintPreview From:=1, To:=1

and the other PrintOut as well.

which was found by recording a macro that did a Print Preview
and substituting the code into the above.
ActiveWindow.SelectedSheets.PrintPreview
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

The macro in the 7/25/03 post works well to have a
different footer on page 2 and none on page 1. I would
prefer the macro not to print, but to go into print
preview. Can you help? Thanks.
 
D

David McRitchie

Hi Paul,
One less method to skin a cat. Sorry didn't think I needed to test.
I will mark the other thread with your answer. The PrintPreview
method does not allow arguments.


Paul Corrado said:
Linda,

I can't seem to get David's adjustment to work in the code I had given to
you (I'm somewhat of a novice programmer so that does not necessarily mean
his suggestion is incorrect)

However, I did find that adding "Preview:=True" to the end of the PrintOut
statements will generate a preview for each section. Once you have the
preview open, I believe you should be able to select "Close" and the page(s)
will not print. After previewing the first section and selecting "Close" the
macro will then preview the second selection.

To be clear, the full statement is below.

ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Preview:=True

HTH

PC


David McRitchie said:
Hi Linda,
The thread for your other post can be referenced by:
http://google.com/[email protected]

I supplied an answer there as well for completeness. Wasn't
immediately seen that you still had a question until the words
"can you help", either that or some of us were asleep.

The macro you used is invoked twice in other words there are
two printings: one for page 1 and one for the remainder of
the pages. You cannot simulate this in Print Preview but
you can look at two separate Print Previews.

Instead of
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1
try
ActiveWindow.SelectedSheets..PrintPreview From:=1, To:=1

and the other PrintOut as well.

which was found by recording a macro that did a Print Preview
and substituting the code into the above.
ActiveWindow.SelectedSheets.PrintPreview
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

The macro in the 7/25/03 post works well to have a
different footer on page 2 and none on page 1. I would
prefer the macro not to print, but to go into print
preview. Can you help? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top