Hi. I recorded this macro in Excel and need to change the range to allow for a variable amount of rows.
Thanks in advance!
Sub PasteSpecialRemoveDups()
'
' PasteSpecialRemoveDups Macro
'
'
Sheets("1_Vendor_Upload").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("2_Lines").Select
Cells.Select
Range("A34").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("3_Parts_Info_Brand").Select
Cells.Select
Range("A34").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("4_Vendor_Brand").Select
Cells.Select
Range("A37").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("5_Product_Line_Catalog_Type").Select
Cells.Select
Range("A37").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("6_Product_Lines_Catalog").Select
Cells.Select
Range("A35").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("7_Vendor_Catalogs").Select
Cells.Select
Range("A40").Activate
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("8_Vendor_Users").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("9_Parts").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1_Vendor_Upload").Select
Cells.Select
Application.CutCopyMode = False
ActiveSheet.Range("$A$1:$D$73").RemoveDuplicates Columns:=Array(1, 2, 3, 4), _
Header:=xlNo
Sheets("2_Lines").Select
Cells.Select
Range("A34").Activate
ActiveSheet.Range("$A$1:$C$73").RemoveDuplicates Columns:=Array(1, 2, 3), _
Header:=xlYes
ActiveWindow.SmallScroll Down:=-3
Sheets("3_Parts_Info_Brand").Select
Cells.Select
Range("A34").Activate
ActiveSheet.Range("$A$1:$B$73").RemoveDuplicates Columns:=Array(1, 2), Header _
:=xlYes
Sheets("4_Vendor_Brand").Select
Cells.Select
Range("A37").Activate
ActiveSheet.Range("$A$1:$B$73").RemoveDuplicates Columns:=Array(1, 2), Header _
:=xlYes
Sheets("5_Product_Line_Catalog_Type").Select
Cells.Select
Range("A37").Activate
ActiveSheet.Range("$A$1:$B$73").RemoveDuplicates Columns:=Array(1, 2), Header _
:=xlYes
Sheets("6_Product_Lines_Catalog").Select
Cells.Select
Range("A35").Activate
ActiveSheet.Range("$A$1:$F$73").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6) _
, Header:=xlYes
Sheets("7_Vendor_Catalogs").Select
Cells.Select
Range("A40").Activate
ActiveSheet.Range("$A$1:$B$73").RemoveDuplicates Columns:=Array(1, 2), Header _
:=xlYes
Sheets("8_Vendor_Users").Select
Cells.Select
ActiveSheet.Range("$A$1:$B$11").RemoveDuplicates Columns:=Array(1, 2), Header _
:=xlYes
Sheets("9_Parts").Select
Cells.Select
ActiveSheet.Range("$A$1:$P$240").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6, _
7, 8, 9, 10, 11, 12, 13, 14, 15, 16), Header:=xlYes
End Sub
Thanks in advance!