picklefactory
Well-known Member
- Joined
- Jan 28, 2005
- Messages
- 508
- Office Version
- 365
- Platform
- Windows
Hi folks, hope someone can help please
I have a worksheet that I am print previewing from a user form but obviously when I print or just close the print preview it just leaves me on the sheet, but I'd like to exit back to the user form or even a different form, either would be good. Is it possible?
In case it helps, I've enclosed the simple bit of code I've used to generate the preview (Simple code is my limit I'm afraid)
Thanks
I have a worksheet that I am print previewing from a user form but obviously when I print or just close the print preview it just leaves me on the sheet, but I'd like to exit back to the user form or even a different form, either would be good. Is it possible?
In case it helps, I've enclosed the simple bit of code I've used to generate the preview (Simple code is my limit I'm afraid)
Thanks
Code:
Private Sub cmdViewMachine_Click()
'Load selected machine to cell C2 in MachineSpec sheet
ActiveWorkbook.Sheets("MachineSpec").Activate
Range("B2").Select
ActiveCell.Value = cboMachineName.Value
Unload frmMachines
ActiveWorkbook.Sheets("MachineSpec").Activate
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$36"
ActiveSheet.PrintOut Preview:=True, ActivePrinter:="Xerox WorkCentre 7428-2 PCL6"
End Sub