PDA

View Full Version : Solved: formula not changing the row values accorrdingly



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

mdmackillop
08-05-2008, 06:03 AM
You are scrolling along the row, not down the column

Pete
08-05-2008, 07:02 AM
hi Madmackillop........managed to find the solution the answer was to do with the order in which the wroksheets where placed this was causing the error......it working fine no need to amend the vba....

just one of those problems that fixes itself....

thanks for the feedback...