Hi all,
I wonder if anyone can help with the small problem i'm having? I'm pretty new to VBA and am having some teething problems....
I'm trying to write a macro which takes a variable which i have already calculated earlier in the macro (VelocityOne), and adds it to the value in the cell above which the newly calculated variable needs to be written. This needs to be repeated for a number of rows. However, the number of rows for which this needs to be done is the value of another variable (intWorkingRowVelEnd). I'm not sure if this description makes any sense, so i've put the code below.
Thanks in advance,
Dave
=================================
ReDim i(intWorkingRowVelEnd) As Variant
Worksheets("Working").Cells(3, 1).Select
For i = 1 To intWorkingRowVelEnd
CFVel = VelocityOne + Cells(1 + i, 1)
Next i
For j = 1 To intWorkingRowVelEnd
Worksheets("Working").Cells(2 + j, 1).Value = CFVel
Next j
I wonder if anyone can help with the small problem i'm having? I'm pretty new to VBA and am having some teething problems....
I'm trying to write a macro which takes a variable which i have already calculated earlier in the macro (VelocityOne), and adds it to the value in the cell above which the newly calculated variable needs to be written. This needs to be repeated for a number of rows. However, the number of rows for which this needs to be done is the value of another variable (intWorkingRowVelEnd). I'm not sure if this description makes any sense, so i've put the code below.
Thanks in advance,
Dave
=================================
ReDim i(intWorkingRowVelEnd) As Variant
Worksheets("Working").Cells(3, 1).Select
For i = 1 To intWorkingRowVelEnd
CFVel = VelocityOne + Cells(1 + i, 1)
Next i
For j = 1 To intWorkingRowVelEnd
Worksheets("Working").Cells(2 + j, 1).Value = CFVel
Next j