+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting

  1. #1
    Registered User
    Join Date
    08-30-2007
    Location
    Dublin, Ireland
    Posts
    18

    Conditional formatting

    Hi all,

    i was wondering if someone could help me vba conditional formatting, i have never used it before.

    What i would like to do is compile a macro that would search through a work book (or on a worksheet by worksheet basis if thats the only way it can be done?) and highlight the following:

    - colour the font of cells that originate from another worksheet
    - colour the font of cells that originate from a different place in the same worksheet
    - colour the font of cells that comprise a total (probably all would include a sum formula
    - colour the background of cells that are hardcoded i.e. do not contain a formula

    i have no idea where to being and would appreciate some help!

    Thanks in advance

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting can you help?

    Hi,

    How about something like:

    Please Login or Register  to view this content.
    Change the colours as appropriate
    HTH
    Last edited by Richard Buttrey; 01-15-2010 at 08:10 AM. Reason: Unnecessary code in original
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-30-2007
    Location
    Dublin, Ireland
    Posts
    18

    Re: Conditional formatting can you help?

    hi richard that seems to work a treat, thank you very very much

  4. #4
    Registered User
    Join Date
    08-30-2007
    Location
    Dublin, Ireland
    Posts
    18

    Re: Conditional formatting can you help?

    just wondering

    is there anyway to set the condition relating to cells whose values originate from within the same sheet so that it will only colour them if they are equal to another cell as opposed to containing a formula that uses a number of cells in the same sheet?

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting can you help?

    Hi,

    Can you be a bit more explicit. i.e. do you want to colour them if the formula is just say =A1 but not if it's say =A1+A2, or something like =VLOOKUP() etc?

    Rgds

  6. #6
    Registered User
    Join Date
    08-30-2007
    Location
    Dublin, Ireland
    Posts
    18

    Re: Conditional formatting can you help?

    hi richard

    yes i just want to colour them if they are =a1, but nothing more than that.

    oh and also what code would i need to change so that the macro just runs on the active sheet Richard? as opposed to cycling thro the entire work book
    Last edited by cyrusir; 01-15-2010 at 08:21 AM.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting can you help?

    Hi,

    I cycled it through all worksheets since that was what your OP requested. To limit it to just the active sheet take out the For x = 1 to Sheets.Count loop and the Sheets(x).activate.

    The revised code should just colour the =A1 type cells.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-30-2007
    Location
    Dublin, Ireland
    Posts
    18

    Re: Conditional formatting

    thats brilliant thank you Richard

+ 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