Hello, I have the following code:
Sub Copy_Rows_RLB()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim nextrow As Long, i As Long<o></o>
<o></o>
Application.ScreenUpdating = False<o></o>
<o></o>
With Worksheets("Payroll")<o></o>
.Unprotect<o></o>
.Range("Top_5").Copy<o></o>
.Range("GrandTotals").Resize(1, 1).Insert Shift:=xlDown<o></o>
<o></o>
For i = 1 To WorksheetFunction.CountIf(Sheets("EEData").Columns("A"), Range("DEPT"))<o></o>
nextrow = .Cells(Rows.Count, "A").End(xlUp).Row<o></o>
Range("A" & nextrow + 1).PasteSpecial<o></o>
<o></o>
Next i
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True<o></o>
<o> </o>
End With
*********
I am having an issue with the resizing range line, let's say that I am pasting the Range Top_5 10 times, well only 1 pasted range appears above the Range Grand Totals, then another 10 are pasted below the Range Grand Totals. Any assistance is appreciated.
Thanks!
Sub Copy_Rows_RLB()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim nextrow As Long, i As Long<o></o>
<o></o>
Application.ScreenUpdating = False<o></o>
<o></o>
With Worksheets("Payroll")<o></o>
.Unprotect<o></o>
.Range("Top_5").Copy<o></o>
.Range("GrandTotals").Resize(1, 1).Insert Shift:=xlDown<o></o>
<o></o>
For i = 1 To WorksheetFunction.CountIf(Sheets("EEData").Columns("A"), Range("DEPT"))<o></o>
nextrow = .Cells(Rows.Count, "A").End(xlUp).Row<o></o>
Range("A" & nextrow + 1).PasteSpecial<o></o>
<o></o>
Next i
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True<o></o>
<o> </o>
End With
*********
I am having an issue with the resizing range line, let's say that I am pasting the Range Top_5 10 times, well only 1 pasted range appears above the Range Grand Totals, then another 10 are pasted below the Range Grand Totals. Any assistance is appreciated.
Thanks!