LoneStarPiper
New Member
- Joined
- Mar 29, 2019
- Messages
- 15
Hello all, I'm not terribly experienced in macros, but I'm learning as I go. Any help is appreciated. I have a workbook with many worksheets inside it. From a master worksheet, I'd like my staff to be able to select which worksheets to print by selecting them with checkboxes. I have a macro written that is trying to say "IF a checkbox is selected, run a print macro (already written)". I continue to get the error " Run-time error '1004': Unable to get the CheckBoxes property of the Worksheet class" and when I selected "debug" it normally takes me to the next line after the page I printed. Any ideas?
Sub PrintSelectedSheets()
'Installer Copy Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chk3installcopies").Value = 1 Then
Call InstallerCopyWPrint
End If
'MISC Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkMISC").Value = 1 Then
Call MISC_PrepareForPrint
Call MISC_Print
End If
'Job Notes Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("JobNotesBox").Value = 1 Then
Call JobNotes_Print
End If
'ALUMINUM Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAlum").Value = 1 Then
Call ALUM_PrepareForPrint
Call ALUM_Print
End If
'Galvalume Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkGalv").Value = 1 Then
Call GALV_PrepareForPrint
Call GALV_Print
End If
'Copper Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkCopper").Value = 1 Then
Call COPPER_PrepareForPrint
Call COPPER_Print
End If
'ALUM HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAlumHalf").Value = 1 Then
Call ALUMHALF_PrepareForPrint
Call ALUMHALF_Print
End If
'Galvalume HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkGalvHalf").Value = 1 Then
Call GALVHALF_PrepareForPrint
Call GALVHALF_Print
End If
'COPPER HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkCopperHalf").Value = 1 Then
Call COPPERHALF_PrepareForPrint
Call COPPERHALF_Print
End If
'CC Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAdmin").Value = 1 Then
Call Admin_Print
End If
End Sub
Sub PrintSelectedSheets()
'Installer Copy Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chk3installcopies").Value = 1 Then
Call InstallerCopyWPrint
End If
'MISC Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkMISC").Value = 1 Then
Call MISC_PrepareForPrint
Call MISC_Print
End If
'Job Notes Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("JobNotesBox").Value = 1 Then
Call JobNotes_Print
End If
'ALUMINUM Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAlum").Value = 1 Then
Call ALUM_PrepareForPrint
Call ALUM_Print
End If
'Galvalume Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkGalv").Value = 1 Then
Call GALV_PrepareForPrint
Call GALV_Print
End If
'Copper Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkCopper").Value = 1 Then
Call COPPER_PrepareForPrint
Call COPPER_Print
End If
'ALUM HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAlumHalf").Value = 1 Then
Call ALUMHALF_PrepareForPrint
Call ALUMHALF_Print
End If
'Galvalume HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkGalvHalf").Value = 1 Then
Call GALVHALF_PrepareForPrint
Call GALVHALF_Print
End If
'COPPER HALF Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkCopperHalf").Value = 1 Then
Call COPPERHALF_PrepareForPrint
Call COPPERHALF_Print
End If
'CC Checkbox values are 0 (false), 1 (true), 2 (changed or grey)
If ActiveSheet.CheckBoxes("chkAdmin").Value = 1 Then
Call Admin_Print
End If
End Sub