Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide/Unhide | Excel Discussion (Misc queries) | |||
hide/unhide | Excel Discussion (Misc queries) | |||
Hide Unhide | Excel Discussion (Misc queries) | |||
Hide/unhide | Excel Worksheet Functions | |||
Hide and unhide | Excel Discussion (Misc queries) |