LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Macro - Whats wrong?

Whatrs wrong with this??

I either get an error saying no data, or can not be used with multiple
selection.

Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 1"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap1
Selection.Copy
lastrow = Sheets("Criteria 1").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 1").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap1:
Application.CutCopyMode = False
Range("A1").Select

Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 2"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap2
Selection.Copy
lastrow = Sheets("Criteria 2").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 2").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap2:
Application.CutCopyMode = False
Range("A1").Select



Any advice?
 
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
whats wrong with this? brownti via OfficeKB.com Excel Discussion (Misc queries) 10 February 12th 07 02:39 PM
Whats wrong with this OR formula? Mark Excel Worksheet Functions 4 October 23rd 06 07:16 PM
Whats wrong with this macro please Mike Excel Discussion (Misc queries) 6 February 5th 06 09:31 PM
Whats wrong with this? LucasBuck Excel Discussion (Misc queries) 3 January 12th 06 08:15 PM
Whats Wrong with this?? drvortex Excel Worksheet Functions 1 October 30th 04 06:48 PM


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