Consulting

Results 1 to 3 of 3

Thread: Solved: formula not changing the row values accorrdingly

  1. #1
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location

    Solved: formula not changing the row values accorrdingly

    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....

    [vba]
    '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[/vba]

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You are scrolling along the row, not down the column
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •