Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Richard,
I believe that there is no direct solution but you can use this code: Private Declare Function OpenClipboard& Lib "user32" (ByVal hwnd&) Private Declare Function EmptyClipboard& Lib "user32" () Private Declare Function CloseClipboard& Lib "user32" () Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte _ , ByVal bScan As Byte, ByVal dwFlags&, ByVal dwExtraInfo&) Private Sub PrintButton_Click() Me.Repaint OpenClipboard 0& EmptyClipboard keybd_event &H2C, 0, 0&, 0& CloseClipboard DoEvents Application.ScreenUpdating = False Dim NewBook As String Workbooks.Add: ActiveSheet.Paste NewBook = ActiveWorkbook.Name With ActiveSheet.PageSetup .RightFooter = Me.Caption & " Le &D Page &P/&N" .PrintGridlines = False .Orientation = xlLandscape .PaperSize = xlPaperA4 .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = False End With ActiveWindow.Visible = False Application.ScreenUpdating = True Me.Hide Windows(NewBook).SelectedSheets.PrintOut Copies:=1 Workbooks(NewBook).Close False Me.Show End Sub Regards, MP "Richard" a écrit dans le message de ... When i insert a button to print the userform, it always comes out in portrait A3. I assume this is from default printer settings? Can i set up the form to print out as i want it to (A4 landscape)? Thanks in advance Richard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
UserForm Print Extra Copies | Excel Discussion (Misc queries) | |||
UserForm: how to print it landscape | Excel Programming | |||
Userform inside another userform | Excel Programming | |||
Making your UserForm print other workbooks | Excel Programming |