Not simple enough for me, unfortunately. It's many years since I worked on VBA and it's true that if you don't use it you lose it. I guess this is very basic stuff
I'm linking macros to checkboxes. If a checkbox is ticked this will run a simple print macro. If it's unticked then nothing should happen. But I keep getting compile errors, either " end if without block if" or "else without if".
I've changed it around a bit but at the moment the script is:
Sub line1()
'
' line1 Macro
'
' If range("L5") = true then
Range("K17:L18").Select
ActiveSheet.PageSetup.PrintArea = "$K$17:$L$18"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Else
Range("K17").Select
End If
End Sub
Appreciate any help. I know this is something most here can do in their sleep.
I'm linking macros to checkboxes. If a checkbox is ticked this will run a simple print macro. If it's unticked then nothing should happen. But I keep getting compile errors, either " end if without block if" or "else without if".
I've changed it around a bit but at the moment the script is:
Sub line1()
'
' line1 Macro
'
' If range("L5") = true then
Range("K17:L18").Select
ActiveSheet.PageSetup.PrintArea = "$K$17:$L$18"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Else
Range("K17").Select
End If
End Sub
Appreciate any help. I know this is something most here can do in their sleep.