Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Hiding/Exposing Rows based on a cell value Tami Excel Worksheet Functions 10 July 11th 09 02:03 PM
Hiding rows based on a cell? OX_Gambit Excel Worksheet Functions 3 July 10th 09 03:05 AM
hiding or showing rows based on a cell value jordanpcpre Excel Discussion (Misc queries) 6 April 24th 08 04:14 PM
Hiding rows based value of cell within row Legion_c18 Excel Discussion (Misc queries) 0 February 22nd 08 06:01 AM
Copy rows based on cell content billinr Excel Discussion (Misc queries) 2 February 14th 07 08:17 PM


All times are GMT +1. The time now is 12:40 AM.

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"