Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows based on cell content
I am looking to hide a row in a worksheet where the column o contain
the value false.This sounds easy but just cant get my head round it -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows based on cell content
try this simple code:
Option Explicit Sub test() delete_row Selection End Sub Sub delete_row(target As Range) If target.Value = "False" Then Rows(target.Row).Delete End If End Sub Patrick Molloy Microsoft Excel MVP -----Original Message----- I am looking to hide a row in a worksheet where the column o contains the value false.This sounds easy but just cant get my head round it. --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows based on cell content
A possible modification
Option Explicit Sub test() Dim rw As Range With ActiveSheet For Each rw In Intersect(.Columns("O"), .UsedRange) Hide_row rw Next End With End Sub Sub Hide_row(target As Range) If Not IsEmpty(target) Then If target.Value = False Then Rows(target.Row).EntireRow.Hidden = True Else Rows(target.Row).EntireRow.Hidden = False End If End If End Sub -- Regards, Tom Ogilvy "Patrick Molloy" wrote in message ... try this simple code: Option Explicit Sub test() delete_row Selection End Sub Sub delete_row(target As Range) If target.Value = "False" Then Rows(target.Row).Delete End If End Sub Patrick Molloy Microsoft Excel MVP -----Original Message----- I am looking to hide a row in a worksheet where the column o contains the value false.This sounds easy but just cant get my head round it. --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding/Exposing Rows based on a cell value | Excel Worksheet Functions | |||
Hiding rows based on a cell? | Excel Worksheet Functions | |||
hiding or showing rows based on a cell value | Excel Discussion (Misc queries) | |||
Hiding rows based value of cell within row | Excel Discussion (Misc queries) | |||
Copy rows based on cell content | Excel Discussion (Misc queries) |