The following code is generating an application defined/object defined error
in the Set Range2 and Set Range3 lines.
I have verified n = 71 and m = 13 (row numbers) on the first execution of the code.
The syntax seems to be the same as in the Set Range1 line. Can you identify the problem?
Thanks very much, Kerry
n = ActiveWorkbook.Sheets("MEMBERS").Range("T8") ' last row for additions
m = ActiveWorkbook.Sheets("MEMBERS").Range("U8") + 1 ' first row for additions
' Resort = ActiveWorkbook.Worksheets("MEMBERS").Range("U10") ' checks if previous sort
' Copy names
Set Range1 = ActiveWorkbook.Worksheets("MEMBERS").Range(Cells(m, 21), Cells(n, 21))
Set Range2 = ActiveWorkbook.Worksheets("PREORDER").Range(Cells(m, 5), Cells(n, 5))
Set Range3 = ActiveWorkbook.Worksheets("Member Purchases").Range(Cells(m, 5), Cells(n, 5))
Range1.Copy
Range2.PasteSpecial xlPasteValuesAndNumberFormats
Range3.PasteSpecial xlPasteValuesAndNumberFormats
in the Set Range2 and Set Range3 lines.
I have verified n = 71 and m = 13 (row numbers) on the first execution of the code.
The syntax seems to be the same as in the Set Range1 line. Can you identify the problem?
Thanks very much, Kerry
n = ActiveWorkbook.Sheets("MEMBERS").Range("T8") ' last row for additions
m = ActiveWorkbook.Sheets("MEMBERS").Range("U8") + 1 ' first row for additions
' Resort = ActiveWorkbook.Worksheets("MEMBERS").Range("U10") ' checks if previous sort
' Copy names
Set Range1 = ActiveWorkbook.Worksheets("MEMBERS").Range(Cells(m, 21), Cells(n, 21))
Set Range2 = ActiveWorkbook.Worksheets("PREORDER").Range(Cells(m, 5), Cells(n, 5))
Set Range3 = ActiveWorkbook.Worksheets("Member Purchases").Range(Cells(m, 5), Cells(n, 5))
Range1.Copy
Range2.PasteSpecial xlPasteValuesAndNumberFormats
Range3.PasteSpecial xlPasteValuesAndNumberFormats