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: 24
Default Advanced Filter Error - I cannot spot my Error

Sub FilterCrit4()
Dim c As Range
Dim rng As Range
Dim LR As Long
LR = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range("A2:S" & LR)
'The following Unique Filter generates an error but I cannot see it
'I had to create my Unique List manually and the rest of the code
' works fine

'Error here --------------------------------------------------------------------
'Range("S2:S" & LR).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("T2"), Unique:=True
'-------------------------------------------------------------------------------

For Each c In Range([T2], Cells(Rows.Count, "T").End(xlUp))
With rng
.AutoFilter
.AutoFilter Field:=19, Criteria1:=c.Value
.SpecialCells(xlCellTypeVisible).Copy
Sheets.Add(After:=Sheets(Sheets.Count)).Name = c.Value
ActiveSheet.Paste
End With
Next c
End Sub

Thank you for your help,
J.P. Charron
 
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
Error msg on Advanced Filter Helen Excel Discussion (Misc queries) 0 April 3rd 08 04:52 PM
Advanced Filter Error Floyd Bates[_2_] Excel Programming 1 July 6th 06 07:19 PM
Advanced Filter - error message Mifty New Users to Excel 2 May 25th 06 07:02 PM
Advanced Filter Error Claret Excel Programming 2 January 24th 06 03:40 PM
advanced filter error 1004 Tove Excel Programming 2 February 28th 05 07:22 PM


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