View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
David Billigmeier
 
Posts: n/a
Default hiding rows with a formula

First, right click on the tab of the worksheet that has the rows you want
hidden and choose "View Code" (you can also hit Alt+F11 and double click your
sheet name). This will open up the VBA window.

Second, just paste in the code.

Third, from your worksheet, hit Alt+F8, click on the "HideRows" macro, and
hit run

Does that help?
--
Regards,
Dave


"Sonia" wrote:

I have never used macros, how do I do it?

"David Billigmeier" wrote:

Select the range of cells you want to check, and run this macro:

Sub HideRows()
Dim rn As Range
Dim rng As Range
Set rng = Selection
For Each rn In rng.Cells
If (rn.Value = "") Then
Rows(rn.Row).Hidden = True
End If
Next
End Sub


--
Regards,
Dave


"Sonia" wrote:

I have a form that I have created in excel and I want to know how to hide
rows automatically, that do not have data in them, with a formula. The form
pulls information from other sheets.