Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
(OP)
I have a spreadsheet that shows some reinforcing choices in a few rows and I would like to have them visible to the user, but not print them in the output. What is the simplest way to do this? (FYI: There are hidden rows in the spreadsheet.)
Thanks
Thanks





RE: Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
Wheels within wheels / In a spiral array
A pattern so grand / And complex
Time after time / We lose sight of the way
Our causes can't see / Their effects.
RE: Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
RE: Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
RE: Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
RE: Excel 2003 - Printing Non-Continuous Rows In Spreadsheet
Make a button, and modify the below macro to fit your needs inside the button. Basically this is how it works.
In my case if my line item sum = 0, then my column A = |.
Then the macro goes through and hides the all the rows temporarly that the | temprorarly. It then prints the page.
Then unhides all the rows it just printed.
Sub LotusPrint()
Dim UnhideRow() As Single
Application.ScreenUpdating = False
' Locate the final row in column A
FinalRow = Range("A65536").End(xlUp).Row
Ctr = 0
' Check and hide each row that starts with a pipe
For x = 1 To FinalRow
If Left(Range("A" & x).Value, 1) = "|" Then
' Do nothing if the row is already hidden
If Not Range("A" & x).EntireRow.Hidden Then
Range("A" & x).EntireRow.Hidden = True
' Save the row number so that it can be unhidden
Ctr = Ctr + 1
ReDim Preserve UnhideRow(Ctr)
UnhideRow(Ctr) = x
End If
End If
Next x
' Print the sheet
ActiveWindow.SelectedSheets.PrintOut
' Unhide any hidden rows
If Ctr > 0 Then
For x = 1 To Ctr
Range("A" & UnhideRow(x)).EntireRow.Hidden = False
Next x
End If
Application.ScreenUpdating = True
End Sub
Hopes this works for you.