+ Reply to Thread
Results 1 to 2 of 2

How to properly apply conditional formatting to a cell based on content

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    How to properly apply conditional formatting to a cell based on content

    Hi,

    I have the code below and I'm trying to understand where the issue is that it's not working as expected. What I'm trying to achieve is to find any cells having the word "BIN" within the active sheet (regardless of any additional content and regardless of where in the sheet they might be), make the text bold, and apply a color to them. THEN, apply the same format to the cell 2 columns to the left, but I don't seem to properly state the declaration.

    This code I modified from the Excel macro recorder, works as to find the cells meeting the criteria, but I'm sure there's a better way to achieve what I'm trying. I then tried to find a way to apply the same format to each cell 2 columns to the left of any occurrence found, but I couldn't.

    Please Login or Register  to view this content.


    The code below I modified from another macro I have where the data needed is in a single column (E), then it applies the same formatting to another cell. I tried to modify it so it now works for what I'm trying to achieve here, but I didn't find the way.

    The highlighted parts of the code are the ones I have no idea how to write. How do I tell Excel here to look in the whole sheet, not just certain column?, How is the color value stated so Excel looks for it and applies it to another cell?

    Please Login or Register  to view this content.

    Your help will be highly appreciated.

    Thanks
    Last edited by axtryo; 05-01-2018 at 09:43 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to properly apply conditional formatting to a cell based on content

    Your post does not comply with Rule 3 of our Forum Rules: Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Replies: 1
    Last Post: 10-04-2016, 05:17 AM
  2. Conditional formatting based on cell content
    By meinthai in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2016, 11:41 PM
  3. Conditional formatting can't apply to all cells properly
    By kelvinvu12 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2015, 12:05 PM
  4. [SOLVED] Add border & apply conditional formatting to sheets based on cell value
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2013, 11:02 AM
  5. [SOLVED] Conditional formatting one cell based on another's content
    By Top12Gun in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-20-2012, 08:59 PM
  6. Replies: 3
    Last Post: 04-30-2011, 11:46 PM
  7. Conditional Formatting based on part content of a cell
    By Paul Sheppard in forum Excel General
    Replies: 2
    Last Post: 09-10-2009, 01:06 PM

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