Hello all the Macro below Sets a defined range of Paqge breaks before a user goes to print priview or print. It deos this so no matter what the user does the page will always print as ther are intended to.
My problem is this works fine on a mac. when I brought it over to a PC environment it it give me a 'Run-time error 1004'
PS I have also posted another problem regarding Cells changing Colour.
I would dearly love to make this a cross platform file. Any suggestions?
much appreciated.
My problem is this works fine on a mac. when I brought it over to a PC environment it it give me a 'Run-time error 1004'
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = Range("Budget!$B$5").Value & Range("'DropList'!$AI$3").Value
If ActiveSheet.Name = "Budget" Then
ActiveWorkbook.Sheets("Budget").PageSetup.PrintArea = "$A$1:$L$67,$M$3:$AE$70,$AF$3:$EN$69"
Set ActiveSheet.VPageBreaks(1).Location = Range("U3")
Set ActiveSheet.VPageBreaks(2).Location = Range("AX3")
Set ActiveSheet.VPageBreaks(3).Location = Range("BQ3")
Set ActiveSheet.VPageBreaks(4).Location = Range("CJ3")
Set ActiveSheet.VPageBreaks(5).Location = Range("DC3")
Set ActiveSheet.VPageBreaks(6).Location = Range("DW3")
ElseIf ActiveSheet.Name = "Casting Estimate" Then
ActiveWorkbook.Sheets("Casting Estimate").PageSetup.PrintArea = "$A$1:$N$70,$O$3:$AG$74"
Else
End If
With ActiveSheet.PageSetup
.Zoom = 75
End With
'Application.Dialogs(xlDialogPrint).Show
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
PS I have also posted another problem regarding Cells changing Colour.
I would dearly love to make this a cross platform file. Any suggestions?
much appreciated.