Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Advanced Filter...

Howdie!!! :)

Heres the problem
3 Sheets:
a)Filters
b)FAQ
c) FAQ_Filtered

On Filters Sheet
A user inputs a value (s) in Cell c2, and or c3 (up to c6).
He then clicks a button which launches a macro.

The macro applys an advanced autofilter on another sheet (called FAQ),
using the value he has input in Cell c2 etc. It then copies and pastes
the result to FAQ_Filtered.

It works fine. HOWEVER, when you enter a value in Cell C2 that appears
IN EVERY LINE of the FAQ sheet, it finds everything (which is also fine)
However the line of VBA below that says "ActiveSheet.ShowAllData" gives
an error because all data is already being shown. I need to tell it to
only showalldata if alldata is not already being shown...?

Any ideas...?

(Sounds complicated, but maybe I just explained it badly_

Code is below


With Sheets("FAQ")
Cells.Select
Range("A1:E40").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("Filters").Range("c1:c6"), Unique:=False
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy

Sheets("FAQ_filtered").Visible = True
Sheets("FAQ_filtered").Select
Range("A1").Select
ActiveSheet.Paste
Cells.EntireColumn.AutoFit
Cells.Select
Selection.RowHeight = 15
ActiveWindow.Zoom = 80

'now remove advanced filter
Sheets("FAQ").Select
ActiveSheet.ShowAllData

'now take user to filtered sheet
Sheets("FAQ_filtered").Select
Range("a1").Select


End With
Sheets("FAQ_filtered").Select

End Sub



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Advanced Filter...

Try the following fix........

'now remove advanced filter
Sheets("FAQ").Select
If ActiveSheet.FilterMode then ActiveSheet.ShowAllData

--
Cheers
Nigel



"Darin Kramer" wrote in message
...
Howdie!!! :)

Heres the problem
3 Sheets:
a)Filters
b)FAQ
c) FAQ_Filtered

On Filters Sheet
A user inputs a value (s) in Cell c2, and or c3 (up to c6).
He then clicks a button which launches a macro.

The macro applys an advanced autofilter on another sheet (called FAQ),
using the value he has input in Cell c2 etc. It then copies and pastes
the result to FAQ_Filtered.

It works fine. HOWEVER, when you enter a value in Cell C2 that appears
IN EVERY LINE of the FAQ sheet, it finds everything (which is also fine)
However the line of VBA below that says "ActiveSheet.ShowAllData" gives
an error because all data is already being shown. I need to tell it to
only showalldata if alldata is not already being shown...?

Any ideas...?

(Sounds complicated, but maybe I just explained it badly_

Code is below


With Sheets("FAQ")
Cells.Select
Range("A1:E40").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("Filters").Range("c1:c6"), Unique:=False
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy

Sheets("FAQ_filtered").Visible = True
Sheets("FAQ_filtered").Select
Range("A1").Select
ActiveSheet.Paste
Cells.EntireColumn.AutoFit
Cells.Select
Selection.RowHeight = 15
ActiveWindow.Zoom = 80

'now remove advanced filter
Sheets("FAQ").Select
ActiveSheet.ShowAllData

'now take user to filtered sheet
Sheets("FAQ_filtered").Select
Range("a1").Select


End With
Sheets("FAQ_filtered").Select

End Sub



*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Advanced Filter...


Your the man!! Works great thanks.

Do you have any idea why the file size gets so huge when you doing these
advanced filters (I actually think its select visible cells and paste
that does it) The spreadsheet has two lines on it, but is already
1.4megs big...?

Thanks

D


*** Sent via Developersdex http://www.developersdex.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
Advanced Filter - filter rows < jaws4518 Excel Discussion (Misc queries) 3 November 1st 06 05:48 PM
Why won't advanced filter return filter results? jaws4518 Excel Worksheet Functions 5 September 12th 06 06:11 PM
How do I use advanced filter to filter for blank cells? Monique Excel Discussion (Misc queries) 2 March 21st 06 06:43 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
advanced filter won't allow me to filter on bracketed text (-456.2 LucianoG Excel Discussion (Misc queries) 1 December 6th 04 08:38 PM


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