View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
loudfish loudfish is offline
external usenet poster
 
Posts: 49
Default how to print a sheet by command

On May 1, 4:36 pm, ghost wrote:
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