ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with range and autofilter (https://www.excelbanter.com/excel-programming/334732-problem-range-autofilter.html)

BigDave[_26_]

Problem with range and autofilter
 


Private Sub CommandButton1_Click()

ActiveWorkbook.RefreshAll

With Worksheets("Findings")
.DisplayPageBreaks = False
Worksheets("EstFindings").Range("a1:b1").AutoFilte r _
Field:=2, _
Criteria1:="=0.01"
.DisplayPageBreaks = True
End With

End Sub


Excel 2002

This macro is running off of a button on Worksheet1. What I'm trying
to do is refresh my PivotTables*then* place an custom AutoFilter on
columns A and B of my worksheet named "findings" that sorts by items
greater than 0%.

When I run the macro, I get an error stating the Range selection method
failed.

Thoughts?


--
BigDave
------------------------------------------------------------------------
BigDave's Profile: http://www.excelforum.com/member.php...fo&userid=7741
View this thread: http://www.excelforum.com/showthread...hreadid=387751


kassie

Problem with range and autofilter
 
Hi

Instead of A1:B1, try A:B

"BigDave" wrote:



Private Sub CommandButton1_Click()

ActiveWorkbook.RefreshAll

With Worksheets("Findings")
.DisplayPageBreaks = False
Worksheets("EstFindings").Range("a1:b1").AutoFilte r _
Field:=2, _
Criteria1:="=0.01"
.DisplayPageBreaks = True
End With

End Sub


Excel 2002

This macro is running off of a button on Worksheet1. What I'm trying
to do is refresh my PivotTables*then* place an custom AutoFilter on
columns A and B of my worksheet named "findings" that sorts by items
greater than 0%.

When I run the macro, I get an error stating the Range selection method
failed.

Thoughts?


--
BigDave
------------------------------------------------------------------------
BigDave's Profile: http://www.excelforum.com/member.php...fo&userid=7741
View this thread: http://www.excelforum.com/showthread...hreadid=387751




All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com