Thread: Hiding Rows
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Fleone Fleone is offline
external usenet poster
 
Posts: 50
Default Hiding Rows

I can't take credit for this bit of code that I collected along the way that
might do what you want. Another more experienced Excel user created it some
time ago.
------
Sub HideRows()

' Hides rows where G is blank

Dim R As Range
For Each R In Range("G5:G29")
If R.Value = "" Then Rows(R.Row).Hidden = True
Next

End Sub
------
If you copy the information between the ---- breaks, you can paste them into
the workbook by right-clicking a tab and selecting View Code. On the left
side of the window there is generally an Explorer view of the workbook
sheets. Look for a folder titled Modules. Right-click that folder and select
Insert then Module. Paste this bit of code there and then close the vb
window. This is now a Macro that is availble to run from the Macros list. It
should be titled HideRows. Just click it and choose the run button.

"Lee" wrote:

Yes, It was a typo. I am sorry about that.
--
Lee


"Gord Dibben" wrote:

Is this a typo.......... both rows 8 & 10?

Should it be 8 & 12?

Select G5:G29 and F5SpecialBlanksOK

Hold CTRL key and Right-click on the row header of active cell and "Hide"


Gord Dibben MS Excel MVP

On Mon, 14 Apr 2008 06:33:01 -0700, Lee wrote:

I want to hide all rows in which any cell from G5:G29 is blank. Lets say if
G8 & G12 are blanks then I would like to hide both rows 8 & 10 . Thanks.