Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"pre-specify" print options
Is there a way to setup the print button to check a cell for a non-blank
status in each sheet of a workbook and have that sheet print based on the status of the cell? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"pre-specify" print options
This code looks at all the worksheets to see if the value in A1 is true and
prints those sheets. Regards, Bill Public Sub PrintSelectSheets_Variable() Dim wkb As Workbook Dim strSheets() As String Dim lngFound As Long Dim i As Long Set wkb = ThisWorkbook lngFound = -1 ' Put all the sheets to print into the strSheets array ReDim strSheets(0 To wkb.Sheets.Count - 1) As String For i = 0 To wkb.Sheets.Count - 1 If (wkb.Sheets(i + 1).Range("A1").Value = True) Then lngFound = lngFound + 1 strSheets(lngFound) = wkb.Sheets(i + 1).Name End If Next i ReDim Preserve strSheets(0 To lngFound) As String wkb.Sheets(strSheets).Printout End Sub "Eric" wrote: Is there a way to setup the print button to check a cell for a non-blank status in each sheet of a workbook and have that sheet print based on the status of the cell? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL allow 2 options on status bar e.g. show "Count" + "Sum" | Excel Discussion (Misc queries) | |||
"Save" and "Save As" options greyed out - "Save as Webpage" option | Excel Discussion (Misc queries) | |||
Shortcut key for "Paste Options" and "Error Checking" buttons? | Excel Discussion (Misc queries) | |||
Debug.Print "Test " vbCodeLineNumber & ": " & varName | Excel Programming | |||
What are the System Tables named "Print Area" & "Print Titles"? | Excel Programming |