LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Autofilter on non-active sheet

HI there,

I'm trying to apply an autofilter to each sheet in my workbook to copy data
to a summary sheet based on criteria.

I keep getting an error on 'sh.Range("Status").AutoFilter , "Open"'

Can anyone help?

For Each sh In ThisWorkbook.Worksheets
If sh.Name < DestSh.Name Then
sh.AutoFilterMode = False

sh.Range("Status").AutoFilter , "Open"

Last = LastRow(DestSh)
shLast = LastRow(sh)

'Copy range and paste into Summary as values
With sh.Range("D2:H2", sh.Cells(sh.Rows.Count, "D").End(xlUp))
DestSh.Cells(Last + 1, "B").Resize(.Rows.Count, _
.Columns.Count).Value = .Value
End With

'Copy sheet name to Summary column A
DestSh.Cells(Last + 1, "A").Value = sh.Name
End If
Next

Thanks
 
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
Macro to Filter on active cell within autofilter Cheekyaardvark Excel Programming 6 December 12th 06 06:23 PM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
autofilter on a not-active sheet Peter[_21_] Excel Programming 2 January 15th 05 12:33 PM
How to count rows in a user-defined AutoFilter or AdvancedFilter is active? Frank Krogh Excel Programming 1 February 26th 04 11:08 AM


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