Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print only if Cell is non-blank
I am getting an "out-of-range" error on this code:
Private Sub PrintButton1_Click() If IsEmpty(Worksheets("Sheet1").Range("A8").Value) Then Worksheets("Sheet1").PrintOut Copies:=1 End If End Sub I have a command button set up such that when clicked, the code should check a certain cell on each sheet of a workbook and print the sheets that have some value in that cell. Any ideas?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print only if Cell is non-blank
subscript out of range for the following code would be an indication the
sheet is not named exactly "Sheet1". There may be a space somewhere in the name as an example. -- Regards, Tom Ogilvy "Eric" wrote: I am getting an "out-of-range" error on this code: Private Sub PrintButton1_Click() If IsEmpty(Worksheets("Sheet1").Range("A8").Value) Then Worksheets("Sheet1").PrintOut Copies:=1 End If End Sub I have a command button set up such that when clicked, the code should check a certain cell on each sheet of a workbook and print the sheets that have some value in that cell. Any ideas?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print Blank Pgs - Preview margins outside print range | Excel Discussion (Misc queries) | |||
Blank Print | Excel Worksheet Functions | |||
How to stop print in blank cell? | Excel Programming | |||
If a cell is blank do no let a user print or save? | Excel Worksheet Functions | |||
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. | Excel Discussion (Misc queries) |