+ Reply to Thread
Results 1 to 11 of 11

Conditional formatting to color a tab when a comment is entered into a cell of a column

  1. #1
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Conditional formatting to color a tab when a comment is entered into a cell of a column

    I was having difficulties writing a macro to conditionally highlight a tab with a specific color when users write a comment into any cell of a column. I would greatly appreciate if you could help.

    Thanks.

  2. #2
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Tx
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Try something like this, where 1 is column A 2 is B etc.

    Please Login or Register  to view this content.


    <------If this helped you please click the star!
    http://excelevangelist.blogspot.com/

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Tx
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    To insert that code right click on the tab you want to insert the code and click "View Code"
    Then paste the code above.



    <------If this helped you please click the star!

  4. #4
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    MarkinTX,

    Thank you for your response. I really appreciate it.

    Unfortunately the macro you suggested wasn't the one that I was looking for. I guess I wasn't very clear on the original post. Essentially what I want is a macro that works just like the conditional formatting function of Excel. If a user enter a note in any cells of a specific column, the tab will be automatically highlighted. Otherwise, nothing will happen.

    Thanks.

  5. #5
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Just to further clarify my point above. I don't want a macro that is executed after the fact. I want something that works just like the conditional formatting feature of Excel where the application automatically performs a task when a certain condition is met. For example, when a comment is entered into a column, the tab will be automatically highlighted. If that comment is removed, the program will again automatically unhighlight the tab.

  6. #6
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Try modifying Martins code to the following, he got it working fine however it relies on the data entry to stay within the same column, i.e. type data and press enter as opposed to tab

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Or a better option may be the following, it will detect any time there is a change in Column A and change the Tab colour accordingly

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Mowgli,

    Thank you very much for your input. I've tried putting the macro into one of the modules in my personal workbook, but I couldn't figure out how to run it. The macro name wouldn't show up on the Macros window. Please help. I'm just a newbie trying to learn Excel macro. Your help is much appreciated.

  9. #9
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Oops,

    It also had a spelling mistake so can understand it not working so well. My computer had crashed so I went onto the iPhone to type in a reply for you (Excuses excuses eh? ). The correct code should be
    Please Login or Register  to view this content.
    If you place this in the "ThisWorkbook" section instead of a module then it should work ok. If not feel free to upload your workbook and I will add the code.

    There will be no macro to call as it automatically runs and changes the tab colour to whichever colour you select in the code as a value for ColorIndex (in this case 9 which is red) every time it detects a change to the contents of a column you select in the code (in this case A). This is a great place to learn as everything I have learnt has pretty much come from this forum

  10. #10
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    You're awesome, Mowgli! Sorry about the crash. It might have taken you a while to type in using iPhone huh?!

    The reason why I had to place it in a module was because my colleagues and I had to format a lot of workbooks and it will take a very long time to put the codes in every single one of them. In addition, not everyone is familiar with macros.

    I've attached the workbook. Essentially, on every tab, if a comment is placed into the column called 'Company Notes', the tab will be highlighted in yellow. In addition, once a note is entered into the columns Client Notes, Requested Element Extension, Requested Element Definition, the tab will be automatically highlighted orange as well. This formatting will overwrite the Company Notes formatting. Let me know if this isn't clear to you.

    report_helpneeded.xls

    A zillion thanks!

  11. #11
    Registered User
    Join Date
    09-17-2012
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Conditional formatting to color a tab when a comment is entered into a cell of a colum

    Mowgli and the excel experts,

    My question has been out for a while and I haven't found the answer yet. Any help would be greatly appreciated.

    Thanks.

+ 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