how to print a sheet by command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a sheet with information. What I want to do is making two commands,
one for print the sheet portrait, and the other one landscape
Can any one help me plzzzzzzzzzzzz
Thanks!
 
How about recording a macro when you print landscape and record another when you
print portrait?
 
yes
can you give the code please

Dave Peterson said:
How about recording a macro when you print landscape and record another when you
print portrait?
 
can you give the code please

You need to come to the party. If you don't know how to record the
macros, you should ask.

More importantly, if you don't know how to record macros, then chances
are you won't know what to do with the code when someone takes the
time out to give it to you.

<cynical>
unless you are going to cut and paste it into some kind of assignment
</cynical>

Here's a taster of the solution, assuming you have activated the
worksheet that you want to modify.

ActiveSheet.PageSetup.Orientation = xlPortrait

And from the Menu, Tools, Macro...Record New Macro....Hit OK.
Do what you want to do (e.g change the page layout)
Then hit the Stop button.
Hit ALT F11, and you should see the code. You may need to click on
Modules and/or Module1 on the left.

HTH

Andrew
 

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

Back
Top