LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default searching for a better way to hide rows

Advanced filter is Excel worksheet functionality - so the help is in Excel
itself - not VBA.

Hopefully they have that help installed. that said, it can be
implemented/controlled via VBA. It is usually best to utilize Excel builtin
functionality in VBA when it makes sense (and it usually does).

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
It is a single line of code.

Range("Database").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Range("Criteria")

(See VBA help)

the trick is to set up the criteria range with the correct criteria.
(advanced filter requires a physical range that has headers and the filter
value. Identical header on the same row criteria represents and AND
condition. On multiple rows under a single header representes OR
conditions.

I only suggest an Advanced filter because you appear to require more than
two criteria.

--
Regards,
Tom Ogilvy


"tjtjjtjt" wrote in message
...
Yes, there are Column Headers. I'm about to look through google, but

does
anyone have examples of programmatic use of the Aadvanced Filter?
--
tj


"Tom Ogilvy" wrote:

To the columns have headers that identify the correct column to filter

on?

then you could get the column location by finding this column header -

then
apply an advanced filter.

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
I have the following macro, which is doing what I want it to do:
Sub ScheduleHideRows()
Application.ScreenUpdating = False
Dim rws As Range
For Each rws In ActiveSheet.UsedRange
If rws.Value = JP1 Then rws.EntireRow.Hidden = True
If rws.Value = JP2 Then rws.EntireRow.Hidden = True
If rws.Value = CDay Then rws.EntireRow.Hidden = True
If rws.Value = RR Then rws.EntireRow.Hidden = True
Next rws
End Sub

Is there a better way?
Here is the scenario:
I run several different reports from the same database.
Each report contains many of the same columns, but each report

displays
the
columns in a different order.
For some of the reports, I need to hide records that match certain
criteria.
The criteria have been defined with public constants.
Is it possible to make an intelligent filter macro that will adjust

to
the
different column orders?
Thanks,

--
tj







 
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
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Searching Columns and Rows Cliff Excel Worksheet Functions 3 April 3rd 06 12:52 AM
searching columns and rows lsu-i-like Excel Discussion (Misc queries) 5 June 20th 05 07:08 PM
Searching for data and inserting new rows Kev427 Excel Discussion (Misc queries) 2 February 1st 05 07:15 AM
Searching a column and copying rows davidshin Excel Worksheet Functions 1 November 10th 04 07:29 PM


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