Results 1 to 2 of 2

Changing an excel formula to a Macro (Allows for more records)

Threaded View

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    21

    Changing an excel formula to a Macro (Allows for more records)

    Hi guys,

    Im totally lost here. I need help converting an excel formula into a macro that will execute to sum specific cells depending on whether it is RED, YELLOW or GREEN.

    Let me explain what I would like to happen: In column 1, the user will enter a number. In column 2 next to it, the user will either enter R for red, Y for yellow, or G for green.

    I need a macro that will determine if the cell in column 2 is red, yellow or green, then take the number next to it, and sum it with all cells that are the same color. I was able to write a formula that will do this but I realized that I might be adding more or less records into this worksheet.

    I'm thinking a loop of some sort, that will determine the first record and the last record, then look in column 2 for all cells that contain R and then sum. Then loop again for Y and then sum. Then loop agin for G then sum.

    Thank you so much for your time!

    I have attatched the file that will give you an example of what I am talking about.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1