+ Reply to Thread
Results 1 to 6 of 6

Macro that combines if statements to code cells based on different criteria?

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Talking Macro that combines if statements to code cells based on different criteria?

    I have an excel sheet that I need to code various cells based on certain conditions. I need to label these cells with text, giving them specific account information, depending on the preceding cells in the row. To do it manually is labor intensive, as there are thousands of rows.

    I attached a sample sheet. Columns A - F list certain data, that will yield the proper account information in columns H-L. This is just one group of many. Is it possible to write a macro that can deliver the results in cells H3-L3, based on information in A3-F3? This is an ever growing list, so ideally, as I add more groups, I can just copy the code and add a new if statement with the new values between A-F to yield new results in H-L? If I am not clear, please let me know. Thank You. Would greatly appreciate your help!

    code sampling.xlsx

  2. #2
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,147

    Re: Macro that combines if statements to code cells based on different criteria?

    On what basis (which column) would the results be delivered? Based on column A?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Macro that combines if statements to code cells based on different criteria?

    It would be based on all columns A-F. So for example, A3-F3 gives one specific condition that I want H3-L3 to have results as in the sample sheet. A4-F4 has similiar conditions, except for F4, but still gives same result for H4-L4 as H3-L3 (this is just how the data works out to be). And basically just follow the criteria down the list to yield H-L. Is this possible? Thanks

  4. #4
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,147

    Re: Macro that combines if statements to code cells based on different criteria?

    But the code needs to identify the conditions. So will the conditions change on each change in a particular column?

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Macro that combines if statements to code cells based on different criteria?

    Yes they will change based on the different "legal Entity" groups, in Column B. I have multiple groups that I'm still putting together. I dont have them all yet. I'm looking for code that can do the function, and as I add more groups, I can just copy/paste the code, add "and", manually change the conditions, and action the new rules. Hope I'm not confusing you

  6. #6
    Registered User
    Join Date
    07-16-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Macro that combines if statements to code cells based on different criteria?

    Sorry, it should B-F, Not A-F. my apologies

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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