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: 117
Default Autofilter - allowing for error


Using the code below provide by Tom Olgivy to copy & paste filtered data to
a second sheet.

Set rng = Sheets("Names").AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1, 1)
rng.Copy Destination:=Worksheets("Feb Results05").Range("A2")

''' Transfer Class No.5 names only.

Selection.AutoFilter Field:=12, Criteria1:="05"
rng.Copy Destination:=Worksheets("Feb Results05").Range("A38")

How do I more to next Criteria:=06 if 05 not found in Field:=12
--
Thank you

Regards
Aussie Bob C.
Using Windows XP Home + Office 2003 Pro
 
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
Excel Autofilter Error linglc Excel Discussion (Misc queries) 1 January 23rd 08 01:14 AM
Excel Autofilter error linglc Excel Discussion (Misc queries) 0 January 23rd 08 12:20 AM
Copy error with Autofilter Jonathan May[_3_] Excel Programming 0 July 15th 04 01:43 PM
autofilter macro causes #VALUE! error Jill[_7_] Excel Programming 3 May 5th 04 12:02 AM
VBA Autofilter error in '97, not 2000 Foggy Excel Programming 3 April 3rd 04 03:57 AM


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