Hi -
I have this really clumsy code that is slowing my macro down (pasted below) I need to loop through a page using the auto filter for several variables and then get the value and paste it into a table. Below is what I wrote, I could not figure out how to loop this so I have pasted this section 30 times... ouch! .... The only change for each section is the auto filter range is increased by one. ie J7, J8, J9, J10 ect. Any ideas would be a great help.
Sheets("Database").Activate
ActiveSheet.Range("Dbase").AutoFilter Field:=8, Criteria1:=Worksheets("Part Nbr Check").Range("J7")
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Part Nbr Check").Select
Range("M1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Sheets("Review").Select
Range("M8").Select
Selection.End(xlDown).Select
ActiveCell.Resize(1, 2).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("P11").Select
ActiveCell.FormulaR1C1 = "='Part Nbr Check'!R[-4]C[-6]"
Range("P11").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
I have this really clumsy code that is slowing my macro down (pasted below) I need to loop through a page using the auto filter for several variables and then get the value and paste it into a table. Below is what I wrote, I could not figure out how to loop this so I have pasted this section 30 times... ouch! .... The only change for each section is the auto filter range is increased by one. ie J7, J8, J9, J10 ect. Any ideas would be a great help.
Sheets("Database").Activate
ActiveSheet.Range("Dbase").AutoFilter Field:=8, Criteria1:=Worksheets("Part Nbr Check").Range("J7")
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Part Nbr Check").Select
Range("M1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Sheets("Review").Select
Range("M8").Select
Selection.End(xlDown).Select
ActiveCell.Resize(1, 2).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("P11").Select
ActiveCell.FormulaR1C1 = "='Part Nbr Check'!R[-4]C[-6]"
Range("P11").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False