Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default VB Error when AutoFiltering a Pivottable

Hi,
I'm trying to run an autofilter in my macro on a pivottable. But when i run
the macro, as soon as it gets to the part where it should autofilter and
select the filter criteria, it pops up an error. Anyone have a similar
experience. Any help would be greatly appreciated.

Code:
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("I4").Select
Selection.AutoFilter
ActiveSheet.Range("$A$4:$H$169").AutoFilter Field:=1,
Criteria1:="=*total*" _
, Operator:=xlAnd
ActiveWindow.SmallScroll Down:=-15

Thanks,
Josh
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default VB Error when AutoFiltering a Pivottable

I think the problem lies in this:

Range("I4").Select
Selection.AutoFilter
ActiveSheet.Range("$A$4:$H$169").AutoFilter Field:=1,
Criteria1:="=*total*" _
, Operator:=xlAnd

You have only selected I4 to be filtered but then you're filtering A4 to
H169? What is the cell range of the data you want to be filtered? And what
column is the filtered list in (*total*)?

Storm

"jxbeeman" wrote:

Hi,
I'm trying to run an autofilter in my macro on a pivottable. But when i run
the macro, as soon as it gets to the part where it should autofilter and
select the filter criteria, it pops up an error. Anyone have a similar
experience. Any help would be greatly appreciated.

Code:
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("I4").Select
Selection.AutoFilter
ActiveSheet.Range("$A$4:$H$169").AutoFilter Field:=1,
Criteria1:="=*total*" _
, Operator:=xlAnd
ActiveWindow.SmallScroll Down:=-15

Thanks,
Josh

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
ODBC PivotTable Error Mike H. Excel Discussion (Misc queries) 0 February 12th 09 02:14 PM
Error Publishing PivotTable to MOSS. MikeM Charts and Charting in Excel 2 November 16th 07 07:45 PM
Error ExportPicture in PivotTable [email protected] Excel Discussion (Misc queries) 0 February 2nd 06 02:06 AM
PivotTable Calculated Item error [email protected] Excel Discussion (Misc queries) 1 September 28th 05 09:32 AM
Pivottable Error mmwheeler Excel Discussion (Misc queries) 0 July 28th 05 01:19 PM


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