LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
G G is offline
external usenet poster
 
Posts: 52
Default Hide AND Exclude?

Is there a feature in Excel that will allow me to EXCLUDE a row from a
calculation? I'm trying to keep the row (don't want to delete it), but
exclude it from calculations.
Here's an example:

A B

1 "Y" 5
2 "Y" 4
3 "N" 5
4 "Y" 3


When I use the following, it HIDES row 3:

Dim cell As Range
For Each cell In Worksheets("worksheet").Range("A1:A4")
If cell.Text < "Y" Then
cell.EntireRow.Hidden = True
End If

However, when I use the following to SORT, it still considers the hidden cell:

Selection.Sort Key1:=Range("A1:A4"), Order1:=xlAscending, Key2:=Range("A1"),
Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom

I want to EXCLUDE cell A3 because it isn't an "Y". Here's what I want to
show:

A

1 3
2 5
3 5

Any ideas?

Thanks.

Gary

 
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
Want to Hide columns in spreadsheet but NOT hide data in chart. KrispyData Charts and Charting in Excel 1 March 20th 09 04:45 PM
A1 = 200:1, B1 is 200 / 1 (200 from A1 - How to exclude :1?) wcooke Excel Worksheet Functions 1 March 5th 08 04:20 PM
Exclude a row from a SUM Andrew Dyson Excel Discussion (Misc queries) 3 January 22nd 07 02:38 PM
Exclude Michell Major Excel Discussion (Misc queries) 2 October 18th 06 11:52 AM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM


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