Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Row Based on cell value

What may I do to automatically hide all rows whos first
cell has the value "NA"?
Thank you,
gary
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Hide Row Based on cell value

Hi Gary,

Here is one way

Sub CopyMe()
Dim sToFind As String
Dim clastrow As Long
Dim myRange As Range

With ActiveSheet
clastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1").EntireRow.Insert
sToFind = "NA"
.Columns("A:A").AutoFilter Field:=1, Criteria1:=sToFind
Set myRange = .Rows("2:" & clastrow +
1).SpecialCells(xlCellTypeVisible).Rows
.Range("A1").EntireRow.Delete
End With
myRange.Hidden = True

End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"GaryF" wrote in message
...
What may I do to automatically hide all rows whos first
cell has the value "NA"?
Thank you,
gary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Row Based on cell value

Thank you Bob.
Gary

-----Original Message-----
Hi Gary,

Here is one way

Sub CopyMe()
Dim sToFind As String
Dim clastrow As Long
Dim myRange As Range

With ActiveSheet
clastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1").EntireRow.Insert
sToFind = "NA"
.Columns("A:A").AutoFilter Field:=1,

Criteria1:=sToFind
Set myRange = .Rows("2:" & clastrow +
1).SpecialCells(xlCellTypeVisible).Rows
.Range("A1").EntireRow.Delete
End With
myRange.Hidden = True

End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"GaryF" wrote in

message
...
What may I do to automatically hide all rows whos first
cell has the value "NA"?
Thank you,
gary



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Hide Row Based on cell value

A pleasure Gary.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Gary Fuller" wrote in message
...
Thank you Bob.
Gary

-----Original Message-----
Hi Gary,

Here is one way

Sub CopyMe()
Dim sToFind As String
Dim clastrow As Long
Dim myRange As Range

With ActiveSheet
clastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1").EntireRow.Insert
sToFind = "NA"
.Columns("A:A").AutoFilter Field:=1,

Criteria1:=sToFind
Set myRange = .Rows("2:" & clastrow +
1).SpecialCells(xlCellTypeVisible).Rows
.Range("A1").EntireRow.Delete
End With
myRange.Hidden = True

End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"GaryF" wrote in

message
...
What may I do to automatically hide all rows whos first
cell has the value "NA"?
Thank you,
gary



.



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 row based on cell value jat Excel Worksheet Functions 2 February 19th 10 09:05 PM
Hide row based on cell value Munchkin Excel Worksheet Functions 2 June 25th 09 02:21 AM
Hide sheets based on Cell value Mike Milmoe Excel Discussion (Misc queries) 4 January 16th 07 05:57 AM
hide rows based on cell value dummster New Users to Excel 1 February 15th 06 11:37 PM
Is there a way to HIDE a row based on a value of a cell ? Reddiance Excel Discussion (Misc queries) 4 January 26th 05 02:57 AM


All times are GMT +1. The time now is 08:25 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"