#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Hide/Unhide row VBA

A form sheet fills a "document" sheet with headings and information with a
blank row between each part. But when a heading repeats (by cell formula),
it appears as empty, so I am using this VBA formula to hide the empty row.
But I have many rows just like it and I would like a single formula that
would check the whole sheet. Luckily, it is every sixth row, i.e.,
A24,A30,A36,A42, etc.

Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Range("A30") = "" Then
Rows("30").Hidden = True
ElseIf Me.Range("A30") "" Then
Rows("30").Hidden = False
End If

How would I have one formula check every sixth row down to say, A200?
Thanks
--
Scafidel
Lafayette, Louisiana
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Hide/Unhide row VBA

Private Sub Worksheet_Change(ByVal Target As Range)

For Each cell In Range("H30:H200").Cells
If IsEmpty(cell) And Int(cell.Row / 6) = cell.Row / 6 Then
cell.Rows.EntireRow.Hidden = True
Else
cell.Rows.EntireRow.Hidden = False
End If
Next cell

End Sub


Użytkownik "Scafidel" napisał w wiadomo¶ci
...
A form sheet fills a "document" sheet with headings and information with a
blank row between each part. But when a heading repeats (by cell
formula),
it appears as empty, so I am using this VBA formula to hide the empty row.
But I have many rows just like it and I would like a single formula that
would check the whole sheet. Luckily, it is every sixth row, i.e.,
A24,A30,A36,A42, etc.

Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Range("A30") = "" Then
Rows("30").Hidden = True
ElseIf Me.Range("A30") "" Then
Rows("30").Hidden = False
End If

How would I have one formula check every sixth row down to say, A200?
Thanks
--
Scafidel
Lafayette, Louisiana



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Unhide [email protected] Excel Discussion (Misc queries) 0 July 24th 08 05:02 PM
hide/unhide brownti Excel Discussion (Misc queries) 3 February 6th 07 07:14 PM
Hide Unhide Colin Excel Discussion (Misc queries) 4 April 9th 06 05:01 PM
Hide/unhide Jock W Excel Worksheet Functions 4 October 4th 05 05:02 PM
Hide and unhide Marcel Excel Discussion (Misc queries) 1 March 10th 05 11:50 PM


All times are GMT +1. The time now is 02:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"