LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Hiding rows based on a column value

You might want to look at this Add-In by Ron DeBruin....

http://www.rondebruin.nl/easyfilter.htm

HTH,

Don

" wrote:

Thanks, this worked great.

and now that I have access through google I can search before I ask
next time. Glad to find such a resource.
Richard Buttrey wrote:
On Sat, 08 Apr 2006 14:41:36 -0700, (Mark
Hansen) wrote:

I am new to this group and VBA. I didn't see a way to search past posts
for this question so if there is a way I missed, please let me know.

I am trying to create a loop that works through the values of a single
column range and then hides rows based on the value of a string in each
cell. The range name is "Vendor" and I want to be able to only view one
vendor at a time. Maybe approaching it from a filtering position rather
than hiding the row might be easier.

Any advice?



I have a similar requirement in one of my applications. I have a range
of cells in a single column each of which evaluate as either "hide" or
"show". i.e they test for the condition that all the cells in a row
are zero with IF(SUM(C10:EK10)<0,"show","hide")

I have a general purpose macro - see below, which is passed a range of
cells to evaluate, and a Boolean True/False which will either hide or
show the range in question


Public Sub Hide_Rows(Myrows As Range, YN As Boolean)
Dim rowcount As Integer
Dim n As Integer

rowcount = Myrows.Count
If YN = False Then
Myrows.Rows.Hidden = YN
Else
For n = 1 To rowcount
If Myrows.Cells(n, 1) = "hide" Then
Myrows.Cells(n, 1).EntireRow.Hidden = True
End If
Next
End If
End Sub


You could extend this and also pass your vendor code as a third
argument. Then use this third argument as a test, and instead of

If Myrows.Cells(n, 1) = "hide" Then...

use

If Myrows.Cells(n, 1) = vendorcode Then...


HTH
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________



 
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 rows based on a cell? OX_Gambit Excel Worksheet Functions 3 July 10th 09 03:05 AM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Hiding Rows in a Range based on column A value tig Excel Programming 9 February 9th 06 05:03 PM
Need help hiding/unhiding column based on autofilter selection in a different column kcleere Excel Programming 1 January 23rd 06 06:21 AM
Hiding rows based on a value John Excel Discussion (Misc queries) 1 July 2nd 05 08:44 PM


All times are GMT +1. The time now is 08:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"