+ Reply to Thread
Results 1 to 12 of 12

Flag value in col d based on value in col b

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2013
    Posts
    5

    Question Flag value in col d based on value in col b

    Hi,
    I need to test a value in column B, and if it is less than 30, offset (0,2) and apply a number format to the value in column d. Then test the next B, and so on. I'm using Excel 2013. Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Flag value in col d based on value in col b

    Hi, welcome to the forum

    Have you looked at using Conditional Formatting for this?
    1. highlight the range you want to apply the conditional formatting to (the range in column D)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =A2<30 format as required
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    Hi SGW, maybe this?

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    09-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Flag value in col d based on value in col b

    No, because I need to automate this for many worksheets on a regular basis. I'm thinking along these lines, but I'm not defining something correctly:
    #Dim b As Range
    For Each b In ActiveSheet.UsedRange
    If b < 30 Then Offset(0, 2).NumberFormat = "?0.0""%*"""
    Next b
    #

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    sgw your code would check every used cell on the active sheet, did you look at the code I posted?

  6. #6
    Registered User
    Join Date
    09-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Flag value in col d based on value in col b

    This looks good, but it has to work across sheets, so I have to set active sheet..I'll fool with this and see, thanks

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    SGW across ALL sheets?

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    You can replace the "set ws = " line with set ws = activesheet, so you can activate the sheet you want, call macro, and activate next sheet, etc

  9. #9
    Registered User
    Join Date
    09-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Flag value in col d based on value in col b

    Yes, Arkadi, across all worksheets in the workbook. I haven't had a chance to try your code yet, it looks promising.

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Flag value in col d based on value in col b

    Hi Arkadi,
    Something's not working through correctly, does not step through each row on the active sheet. Thanks--I'll spend some more time with this.

  12. #12
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Flag value in col d based on value in col b

    Works on my end, but it only works through rows where b is not blank.
    Let me know if and when I can help more

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to flag list of cities based on continent?
    By bristly in forum Excel General
    Replies: 6
    Last Post: 05-28-2013, 07:54 AM
  2. [SOLVED] Sum top 5 values based based on flag value
    By Snoopy2003 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-08-2012, 10:27 AM
  3. Update One Spreadsheet from several others based on a Flag
    By kpierce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2011, 10:28 PM
  4. flag 2-3 smallest numbers based on 2 columns
    By alizok in forum Excel General
    Replies: 7
    Last Post: 03-13-2008, 01:06 PM
  5. Creating a Flag based on cell value
    By Dan G. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2006, 03:50 PM

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