Hello,
Sub Macro2()
'
' Macro2 Macro
Range("AR10") = "ENSURE THERE IS ENOUGH PAPER."
'Application.Wait (Now + #12:02:00 AM#)
Dim x As Long
For x = 1 To Range("EG1:EG131").Rows.Count
If Range("EG1:EG131").Cells(x, 1) <> "" Then
If Range("EG1:EG131").Cells(x, 1) = "N" Then
Range("D7") = Range("EE1").Cells(x, 1)
Range("d4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$A$1:$AE$75"
Application.Wait (Now + #12:00:01 AM#)
ElseIf Range("EG1:EG131").Cells(x, 1) = "M" Then
Range("AU7") = Range("EE1").Cells(x, 1)
Range("AU4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$AR$1:$BV$75"
Application.Wait (Now + #12:00:01 AM#)
ElseIf Range("EG1:EG131").Cells(x, 1) = "KOS" Then
Range("CL7") = Range("EE1").Cells(x, 1)
Range("CL4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$CI$1:$DM$75"
Application.Wait (Now + #12:00:01 AM#)
End If
Next x
End Sub
I have a sheet that basically has three columns with a location (EE), a name( EF) and a menu type (EG). The macro used to cycle through the list and and the location and name to each menu before printing it out. Before I had three separate worksheets, one for each type. I was trying to print all from the one sheet and just change the print area based on the type. The above macro was my attempt but always returns an error. Is there something I am doing wrong? Any help would be appreciated. Thank you.
Sub Macro2()
'
' Macro2 Macro
Range("AR10") = "ENSURE THERE IS ENOUGH PAPER."
'Application.Wait (Now + #12:02:00 AM#)
Dim x As Long
For x = 1 To Range("EG1:EG131").Rows.Count
If Range("EG1:EG131").Cells(x, 1) <> "" Then
If Range("EG1:EG131").Cells(x, 1) = "N" Then
Range("D7") = Range("EE1").Cells(x, 1)
Range("d4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$A$1:$AE$75"
Application.Wait (Now + #12:00:01 AM#)
ElseIf Range("EG1:EG131").Cells(x, 1) = "M" Then
Range("AU7") = Range("EE1").Cells(x, 1)
Range("AU4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$AR$1:$BV$75"
Application.Wait (Now + #12:00:01 AM#)
ElseIf Range("EG1:EG131").Cells(x, 1) = "KOS" Then
Range("CL7") = Range("EE1").Cells(x, 1)
Range("CL4") = Range("EF1").Cells(x, 1)
ActiveSheet.PageSetup.PrintArea = "$CI$1:$DM$75"
Application.Wait (Now + #12:00:01 AM#)
End If
Next x
End Sub
I have a sheet that basically has three columns with a location (EE), a name( EF) and a menu type (EG). The macro used to cycle through the list and and the location and name to each menu before printing it out. Before I had three separate worksheets, one for each type. I was trying to print all from the one sheet and just change the print area based on the type. The above macro was my attempt but always returns an error. Is there something I am doing wrong? Any help would be appreciated. Thank you.