Consulting

Results 1 to 2 of 2

Thread: Help VBA CODE to include negatives in the loop calculation

  1. #1

    Help VBA CODE to include negatives in the loop calculation

    Hi All,
    Please i need your expert help on tweaking the attached code to include the negatives in the calculation.
    Please find the attached file .expected result in column in GC31 is -116 but at present it gives 0


    basically this code is looping the avg sales qty and deducting from the oldest age bucket.
    Advance thank you for your support.
    Attached Files Attached Files

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    What a nightmare of a very incomplete spreadsheet. I've just spent the better part of the evening attempting to determine what's happening. I failed.

    It would have really helped if you had included comments about what each section of the sheet was supposed to accomplish.

    I suspect that columns (S to SJ,) and (FQ to GZ,) and (HA to II,) and (IN to end) are merely Helper columns for calculating various values. I further suspect that several of those Helper tables are to project future Stock material purchases.

    I would have placed each Helper table on its own sheet.

    A major problem is that many of those tables are laid out in reverse chronological order, which requires the use of weird Arrays and Select Cases, instead of simple calculations like
    (salesProj = Cells(This_Row, "FM").Value) and (Result = Cells((ThisColumn - n)/4, ThisRow)).

    I specifically looked at the [Select Case temp] but you have changed the values in the Result array 36 times, and I could not follow the logic. It would have really helped if you had included comments about what each section of code was supposed to accomplish.

    Sorry I couldn't be more help. st

Posting Permissions

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