Need ttne code for row selection

Closed
ahmed - Aug 20, 2009 at 03:10 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 21, 2009 at 08:42 PM
Hello,
i have created a macro in which i have some specific rows to be selected ans pasted in some other sheet but.but htis macro runs fine for this file if have some other data and the rows are diffrent it doesnt work properly so can u please give some cod for putting it in correct rows
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="1"
Range("J3").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("3:3128").Select
Range("J3").Activate
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="CRB CANCELLED."
Range("H5").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("5:2486").Select
Range("H5").Activate
Selection.Interior.ColorIndex = 54
Range("A1").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="INVALID/INCOMPLETE, HOLD."
Selection.AutoFilter Field:=9, Criteria1:="Match"
Range("I558").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("558:2696").Select
Range("I558").Activate
With Selection.Interior
.ColorIndex = 38
.Pattern = xlSolid
End With
Selection.Copy
Sheets("Final Outstanding QF").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Range("A1").Select
Application.CutCopyMode = False
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="INVALID/INCOMPLETE."
Selection.AutoFilter Field:=9, Criteria1:="Match"
Range("I2").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("2:3016").Select
Range("I2").Activate
Selection.Copy
With Selection.Interior
.ColorIndex = 38
.Pattern = xlSolid
End With
Selection.Copy
Sheets("Final Outstanding QF").Select
Range("H1").Select
Selection.End(xlDown).Select
Range("A12").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Range("A1").Select
Application.CutCopyMode = False
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="VALID, HOLD."
Range("H2679").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("2679:2690").Select
Range("H2679").Activate
Selection.Copy
Sheets("Valid Orders").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="VALID."
Range("H869").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("869:2983").Select
Range("H869").Activate
Selection.Copy
Sheets("Valid Orders").Select
Range("H1").Select
Selection.End(xlDown).Select
Range("A4").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="="
Range("D3").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("3:3030").Select
Range("D3").Activate
Selection.Copy
Sheets("Completed QF").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=9, Criteria1:="="
Selection.AutoFilter Field:=8, Criteria1:="<>CRB CANCELLED.", Operator:= _
xlAnd
Range("H48").Select
Range(Selection, Selection.End(xlDown)).Select
Rows("48:59").Select
Range("H48").Activate
Selection.Copy
Sheets("Revalidate").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Reconciliation").Select
Range("A1").Select
Application.CutCopyMode = False
Selection.AutoFilter
ActiveWorkbook.Save

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Aug 21, 2009 at 08:42 PM
there are too many select. If you tell us what you want to do somebody can prepare a new macro for you.
1