I've included a few print macros in a Excel file, helped along the way in this forum.
The macro works when a checkbox is ticked. The output in this case is cell J4.
I've defined a variable (printfilling) which is then used to define number of copies to be printed. Obviously I could just leave the number in the main part of the macro.
But I would like to enable the user to define the value of the variable using an input box.
Any help gratefully received.
Sub filling()
'
' filling Macro
'
Dim printfilling As Integer
printfilling = 3
If Range("j4") = True Then
ActiveSheet.PageSetup.PrintArea = "$b$41:$ac$68"
ActiveWindow.SelectedSheets.PrintOut Copies:=printfilling, Collate:=True, IgnorePrintAreas:=False
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
Else
Range("j4").Select
End If
End Sub
The macro works when a checkbox is ticked. The output in this case is cell J4.
I've defined a variable (printfilling) which is then used to define number of copies to be printed. Obviously I could just leave the number in the main part of the macro.
But I would like to enable the user to define the value of the variable using an input box.
Any help gratefully received.
Sub filling()
'
' filling Macro
'
Dim printfilling As Integer
printfilling = 3
If Range("j4") = True Then
ActiveSheet.PageSetup.PrintArea = "$b$41:$ac$68"
ActiveWindow.SelectedSheets.PrintOut Copies:=printfilling, Collate:=True, IgnorePrintAreas:=False
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
Else
Range("j4").Select
End If
End Sub