Hi can anyone help with replacing the lines in RED with the lines in Blue to multiple subs?
Code:
Sub dups1()
[COLOR=#ff0000] Sheets("Sheet11").Select
Dim Sheet11 As Worksheet: Set Sheet11 = Sheet11
Dim lRow As Long
lRow = Sheet11.Cells(Rows.Count, "A").End(xlUp).Row[/COLOR]
Range("A1:BD" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter
ActiveSheet.Range("A1:BD" & lRow).AutoFilter Field:=3, Criteria1:="6"
Selection.Copy
Sheets("Sheet12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("Sheet11").Select
Application.CutCopyMode = False
Selection.AutoFilter
Range("A1").Select
Sheets("Sheet2").Select
End Sub
Code:
Sub dups2()
[COLOR=#0000ff] Dim Sheet2 As Worksheet: Set Sheet2 = Sheet02
Dim Sheet11 As Worksheet: Set Sheet11 = Sheet11
Dim lRow As Long
Application.ScreenUpdating = False
lRow = Sheet11.Cells(Rows.Count, "A").End(xlUp).Row
Sheet11.Activate[/COLOR]
Range("A1:BD" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter
ActiveSheet.Range("A1:BD" & lRow).AutoFilter Field:=51, Criteria1:="-5"
Selection.Copy
Sheets("Sheet12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("Sheet11").Select
Application.CutCopyMode = False
Selection.AutoFilter
Range("A1").Select
Sheets("Sheet2").Select
End Sub
Any help would be appreciated
Regards
pwill