Pete
08-05-2008, 03:11 AM
see snippet code
Hi
cannot get the following part of the formula 'CashFlow Q4'!$F" & to scroll down the column accrodingly i.e. the F (number) value does not change......i can post the full macro code if required....
'Loop through each column in current row
curCol = 6
startrow = lastSupplierRow.Row - 3
While (ws.Cells(5, curCol).Value <> "")
'Assign formula
ws.Cells(startrow + 1, curCol).Formula = "=SUM(" & "OFFSET(" & "'CashFlow Q4'!$F" & _
startrow + 1 & "," & "0," & "(INT(RIGHT(" & ws.Cells(5, curCol).Address & _
", 2))-INT(RIGHT('CashFlow Q4'!$F$5)))*4," & "1," & "4" & ")" & ")"
curCol = curCol + 1
Wend
Hi
cannot get the following part of the formula 'CashFlow Q4'!$F" & to scroll down the column accrodingly i.e. the F (number) value does not change......i can post the full macro code if required....
'Loop through each column in current row
curCol = 6
startrow = lastSupplierRow.Row - 3
While (ws.Cells(5, curCol).Value <> "")
'Assign formula
ws.Cells(startrow + 1, curCol).Formula = "=SUM(" & "OFFSET(" & "'CashFlow Q4'!$F" & _
startrow + 1 & "," & "0," & "(INT(RIGHT(" & ws.Cells(5, curCol).Address & _
", 2))-INT(RIGHT('CashFlow Q4'!$F$5)))*4," & "1," & "4" & ")" & ")"
curCol = curCol + 1
Wend