S
stacia
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:
Sub b8pastetitle()
Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") > 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste
End If
Next
End Sub
This is what I have so far:
Sub b8pastetitle()
Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") > 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste
End If
Next
End Sub