Using a solution for another column I tried to fill in some detail for a sheet that gets thrown into excel. The code is as follows.
The problem with this particular code is that it continues down my data and only copies the last line ie. "SPP" instead of looping through like I thought it would.
I picked the "With Range("A1").CurrentRegion.Columns(1)" from a solution provided by Fazza to another user.
As I said it works for my other info which is simply copying a formula down but not here.
Can anybody help me?
Code:
Sub Test()
Columns("H:I").Insert Shift:=xlToLeft
With Range("A1").CurrentRegion.Columns(1)
.Offset(RowCount, 7).Value = "Pay"
.Offset(RowCount, 8).Value = "Basic"
.Offset(RowCount + 1, 7).Value = "Pay"
.Offset(RowCount + 1, 8).Value = "Day Rate"
.Offset(RowCount + 2, 7).Value = "Overtime"
.Offset(RowCount + 2, 8).Value = "O/T 1.5"
.Offset(RowCount + 3, 7).Value = "Holiday"
.Offset(RowCount + 3, 8).Value = "Hol Pay"
.Offset(RowCount + 4, 7).Value = "Holiday"
.Offset(RowCount + 4, 8).Value = "Bnk Hol Pay"
.Offset(RowCount + 5, 7).Value = "RD Work"
.Offset(RowCount + 5, 8).Value = "Mon-Fri"
.Offset(RowCount + 6, 7).Value = "RD Work"
.Offset(RowCount + 6, 8).Value = "Sat"
.Offset(RowCount + 7, 7).Value = "RD Work"
.Offset(RowCount + 7, 8).Value = "Sun"
.Offset(RowCount + 8, 7).Value = "Crooklands"
.Offset(RowCount + 8, 8).Value = "RD Prem"
.Offset(RowCount + 9, 7).Value = "Crooklands"
.Offset(RowCount + 9, 8).Value = "Night Prem"
.Offset(RowCount + 10, 7).Value = "Other"
.Offset(RowCount + 10, 8).Value = "Bulk"
.Offset(RowCount + 11, 7).Value = "Sick"
.Offset(RowCount + 11, 8).Value = "Comp Sick"
.Offset(RowCount + 12, 7).Value = "Sick"
.Offset(RowCount + 12, 8).Value = "SSP"
.Offset(RowCount + 13, 7).Value = "Sick"
.Offset(RowCount + 13, 8).Value = "SPP"
End With
End Sub
The problem with this particular code is that it continues down my data and only copies the last line ie. "SPP" instead of looping through like I thought it would.
I picked the "With Range("A1").CurrentRegion.Columns(1)" from a solution provided by Fazza to another user.
As I said it works for my other info which is simply copying a formula down but not here.
Can anybody help me?