I bet you're running xl2k (or below).
I think what's happening is that even though you hid some rows, excel's print
engine still finds page breaks that are in those hidden rows. And even worse,
it respects those page break marks and forces new pages when you print.
And to make matters worse (well, maybe), if you use a multi-area print range,
then each area will be printed on its own sheet of paper.
If that's not a problem, you may be able to use a routine like this:
Option Explicit
Sub testme()
Dim wks As Worksheet
Dim ExistingPrintRng As Range
Dim VisiblePrintRng As Range
Set wks = Worksheets("Sheet1")
With wks
'make sure that the printarea has been set!
Set ExistingPrintRng = Nothing
On Error Resume Next
Set ExistingPrintRng = .Range(.PageSetup.PrintArea)
On Error GoTo 0
'if the print range hasn't been set, use the .usedrange
If ExistingPrintRng Is Nothing Then
Set ExistingPrintRng = .UsedRange
End If
Set VisiblePrintRng = Nothing
On Error Resume Next
Set VisiblePrintRng _
= ExistingPrintRng.Cells.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If VisiblePrintRng Is Nothing Then
MsgBox "Nothing to print!"
Else
VisiblePrintRng.PrintOut preview:=True 'preview for testing
End If
End With
End Sub
Essentially, it just selects the print range, then uses
Edit|goto|special|visible cells only and then prints that.
==========
If it's a problem that each area of that multi-area print range prints on its
own sheet, you could copy the worksheet (or data as values and formats and
columnwidths and rowheights and ...) to a new worksheet, delete the hidden rows
and print normally.
I _think_ xl2002 was the first version of excel to ignore the page breaks on
those hidden rows. So upgrading may be another choice????