View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Help on Macro to hide empty rows

Option Explicit
Sub PrintOrmondBeach()

Dim myCell As Range
Dim myRng As Range

With Worksheets("Ormond")
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))

For Each myCell In myRng.Cells
If Trim(myCell.Value) = "" Then
myCell.EntireRow.Hidden = True
End If
Next myCell

.PrintOut

.UsedRange.Rows.Hidden = False '<-- added

End With

End Sub

nLeBlanc21 wrote:

Thank you so much Dave! It actually works! You have no idea how much
better this macro will make everything. If I could bother you one more
time though, I recorded a macro to unhide all the rows in the worksheet
after it is printed. That way the administrator can print the worksheet
without all the extra rows, but still have all the rows open to enter
information after she has printed it. When I pasted my recorded macro
into the macro you wrote, it didn't work. Again, thank you so much for
your time and help!

--
nLeBlanc21


--

Dave Peterson