+ Reply to Thread
Results 1 to 7 of 7

Macro for formatting fonts and cell colours - not Conditional Formatting

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Victoria Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Macro for formatting fonts and cell colours - not Conditional Formatting

    Hi all.

    I've got a spreadsheet that I need to format according to different cell values.

    I have a list in column K where the user can select the probability percentage of winning a project. These values are 25, 50, 75 or 100. I want the text in rows from columns A to L to change to a specific colour based on which value is selected (Red for 25, Orange for 50, Blue for 75 and Green for 100).

    I also have a list in column L where the user can select the current status of the project. These values are "Concept", "Design", "Tender - Main", "Tender - Sub", "Applicator Appointed" and "Awarded". I want the background colour of the row from columns A to L to change to a specific colour based on which value is selected (RGB 255, 229, 238 for Concept; RGB 217, 240, 255 for Design; RGB 229, 255, 232 for Tender - Main; RGB 252, 255, 222 for Tender - Sub; RGB 255, 239, 224 for Applicator Appointed; RGB 244, 235, 255 for Awarded), whilst maintaining the text colour that was applied according to column K.

    I can do either of these via conditional formatting, but not both.

    I've searched and searched but due to my extremely limited VBA experience, I just can't seem to find anything that I can adapt for this purpose.

    Does anyone have a macro formula that will help me achieve this?

    Many thanks, Kay.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    Can you please attach the spreadsheet? It will be easier to test the formats.

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    Do you have Excel 2003 or later? If Excel 2003 you only have 3 conditions (4 if you count the default), which means you are stuffed, as you would need 16. If you have 2007 or 2010 use formula rules in the setup all of the conditions and make sure the Stop if True checkbox is not checked.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    Please Login or Register  to view this content.
    Last edited by snb; 10-06-2011 at 05:08 AM.



  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Victoria Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    Thanks heaps for the replies.

    I've attached a sample of the spreadsheet. I'm using Excel Mac:2011.

    snb: I tried your code but got a runtime error "13", type mismatch.

    Cheers.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    Kayaness,

    You can use a Select Case Statement in the Last Column or wherever you want the FillCOlour to be changed based on the DATA..

    Please Login or Register  to view this content.
    Regards
    e4excel

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro for formatting fonts and cell colours - not Conditional Formatting

    I didn't provide a solution. Please adapt my suggestion to your situation.

+ 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