+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 script with 6 conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    07-01-2011
    Location
    PA, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Excel 2007 script with 6 conditions

    Hello,

    I have been searching all over the net for an example that closely mirrors what I am trying to do and have been unsuccessful getting anything to work so I thought I would ask for some assistance. I am looking to add a script in my workbook that will perform multiple if statements and if any are true it will place a “D” in column A of that row. I currently manually do this process with the use of filters, but thought a script would make my life a little easier.

    So if any of the following criteria are true then I would place a D in column A

    Criteria 1: IF MRP (Column I) = JH
    Criteria 2: IF Lev (Column B) = 2 and UOM (Column L) = #N/A
    Criteria 3: IF Lev (Column B) = 2 and UOM (Column L) = EA and BWS (Column K) < 5
    Criteria 4: IF Lev (Column B) = 2 and UOM (Column L) = EA and BWS (Column K) < 50 and RTL (Column H) < 16
    Criteria 5: IF Lev (Column B) = 2 and UOM (Column L) = EA and BWS (Column K) < 100 and RTL (Column H) < 10
    Criteria 6: IF Lev (Column B) = 2 and CTR (Column J) = 228 or 229

    I have attached a small sample page that generally shows the layout of my workbook

    Lastly and this certainly is not necessary but if anyone likes the extra challenge, It would a huge bonus if I could also tell the script to change the font color to red (for the entire row) if UOM (Column L) contains (M, L, or KG)

    I would to thank you guys in advance for taking your time to try and help me with my problem.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-01-2011
    Location
    PA, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel 2007 script with 6 conditions

    Does anyone have a suggestion? I don't mind trying to figure out how to write the script myself but could use some direction on where I might find the best reference material.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Excel 2007 script with 6 conditions

    hi, greywolfe, sort of that, please check attachment, run code "test", hope this helps
    Attached Files Attached Files
    Last edited by watersev; 07-01-2011 at 06:52 PM.

  4. #4
    Registered User
    Join Date
    07-01-2011
    Location
    PA, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel 2007 script with 6 conditions

    Watersev,

    The script works great. Thank you very much for your help.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Excel 2007 script with 6 conditions

    if you are happy with help provided please mark the thread as solved (see Forum Rules for details)

+ Reply to Thread

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