#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 207
Default Print layout

capt,
Try this:
Private Sub CommandButton3_Click()
Worksheets("UserForm1").Activate
ActiveSheet.PageSetup.Orientation = xlLandscape
ActiveSheet.PrintOut

End Sub
In this example, "UserForm1" would change to the sheet name(ie Sheet1).
hth
:-)
"capt" wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

Thanks for that,
But its not working.
On sheet1 I have a command button that brings up my userform and its this
userform I wish to print. I can get it to print but only on portrate The
problem is that it does not fit the page.
--
capt


"FloMM2" wrote:

capt,
Try this:
Private Sub CommandButton3_Click()
Worksheets("UserForm1").Activate
ActiveSheet.PageSetup.Orientation = xlLandscape
ActiveSheet.PrintOut

End Sub
In this example, "UserForm1" would change to the sheet name(ie Sheet1).
hth
:-)
"capt" wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Print layout

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt


"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Print layout

That code plops down a picture of the userform onto a new sheet.

If you record a macro when you change the page setup to landscape, you'll see
that the code looks something like:

ActiveSheet.PageSetup.Orientation = xlLandscape



capt wrote:

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt

"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

Thanks Dave,
It works well. All I need to do is to reduce the size of the print, its
printing on two pages on landscape.
I shall try running a macro and extracting the code.......hopefully!!!
--
capt


"Dave Peterson" wrote:

That code plops down a picture of the userform onto a new sheet.

If you record a macro when you change the page setup to landscape, you'll see
that the code looks something like:

ActiveSheet.PageSetup.Orientation = xlLandscape



capt wrote:

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt

"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

Sorry dave,
I am trying to reduce the size of the printing to fit on a A4 size paper,
cant manage it.
Iv tried running a macro and pasting the code over, but no joy.
Could you help
--
capt


"capt" wrote:

Thanks Dave,
It works well. All I need to do is to reduce the size of the print, its
printing on two pages on landscape.
I shall try running a macro and extracting the code.......hopefully!!!
--
capt


"Dave Peterson" wrote:

That code plops down a picture of the userform onto a new sheet.

If you record a macro when you change the page setup to landscape, you'll see
that the code looks something like:

ActiveSheet.PageSetup.Orientation = xlLandscape



capt wrote:

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt

"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

--

Dave Peterson


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Print layout

Actually Dave, I have sorted it out with the following code:

ActiveSheet.PageSetup.zoom = 85

Thanks again
--
capt


"capt" wrote:

Sorry dave,
I am trying to reduce the size of the printing to fit on a A4 size paper,
cant manage it.
Iv tried running a macro and pasting the code over, but no joy.
Could you help
--
capt


"capt" wrote:

Thanks Dave,
It works well. All I need to do is to reduce the size of the print, its
printing on two pages on landscape.
I shall try running a macro and extracting the code.......hopefully!!!
--
capt


"Dave Peterson" wrote:

That code plops down a picture of the userform onto a new sheet.

If you record a macro when you change the page setup to landscape, you'll see
that the code looks something like:

ActiveSheet.PageSetup.Orientation = xlLandscape



capt wrote:

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt

"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

--

Dave Peterson


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Print layout

Glad you got it working.

Recording a macro when you do the page setup gives you lots of things that you
may not need to change. In your modified code, just keep the lines of code that
are associated with what you want changed (.zoom and .orientation).

If you delete (or comment that code) that you don't need, you may notice that
your macro takes less time to execute.

capt wrote:

Actually Dave, I have sorted it out with the following code:

ActiveSheet.PageSetup.zoom = 85

Thanks again
--
capt

"capt" wrote:

Sorry dave,
I am trying to reduce the size of the printing to fit on a A4 size paper,
cant manage it.
Iv tried running a macro and pasting the code over, but no joy.
Could you help
--
capt


"capt" wrote:

Thanks Dave,
It works well. All I need to do is to reduce the size of the print, its
printing on two pages on landscape.
I shall try running a macro and extracting the code.......hopefully!!!
--
capt


"Dave Peterson" wrote:

That code plops down a picture of the userform onto a new sheet.

If you record a macro when you change the page setup to landscape, you'll see
that the code looks something like:

ActiveSheet.PageSetup.Orientation = xlLandscape



capt wrote:

Thanks dave,
It works, but can you explain again how i change the layout to landscape?
--
capt

"Dave Peterson" wrote:

Tom Ogilvy has posted this a few times:

http://groups.google.co.uk/group/mic...389691 309003

or
http://snipurl.com/14p7q

You can get the code to print in landscape by recording a macro when you do it
once.

capt wrote:

I have the following code to print UserForm1.

Private Sub CommandButton3_Click()
UserForm1.PrintForm
End Sub

How do I get it to print in landscape?

Thank you
--
capt

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
How can I print 2 pages per sheet in a LANDSCAPE layout? djp Excel Discussion (Misc queries) 1 February 15th 07 03:57 PM
How do I print a page with a horizontal layout? Bev Excel Discussion (Misc queries) 2 July 27th 06 02:59 PM
Can view file in print preview, but not print layout.... kkaden Excel Discussion (Misc queries) 1 March 22nd 06 05:54 PM
Code for Print Layout Phil Osman Excel Discussion (Misc queries) 1 March 31st 05 06:18 AM


All times are GMT +1. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"