Hi, I've had the unfortunate task of trying to understand a piece of VBA written by another user (clearly more proficient than me) and amend it.
See below
Sub Agency()
Dim i As Long, tgt As Long
Dim cols As Variant
cols = Array(2, 15, 28, 41, 54, 67, 80, 93)
For i = 3 To 502
tgt = Cells(i, 28) - 1
cl = cols(tgt) + (Cells(i, 22) + 2)
rw = ((5 * Cells(i, 23)) + 3) + (Cells(i, 24) - 1)
Cells(i, 15) = Round(Worksheets("Info").Cells(rw, cl) * 100, 1)
Next i
The section in red I'm having the most problems with. I know this is probably simple, but I have very limited VBA experience. Any advice would be great.
Thanks!!!
See below
Sub Agency()
Dim i As Long, tgt As Long
Dim cols As Variant
cols = Array(2, 15, 28, 41, 54, 67, 80, 93)
For i = 3 To 502
tgt = Cells(i, 28) - 1
cl = cols(tgt) + (Cells(i, 22) + 2)
rw = ((5 * Cells(i, 23)) + 3) + (Cells(i, 24) - 1)
Cells(i, 15) = Round(Worksheets("Info").Cells(rw, cl) * 100, 1)
Next i
The section in red I'm having the most problems with. I know this is probably simple, but I have very limited VBA experience. Any advice would be great.
Thanks!!!