+ Reply to Thread
Results 1 to 4 of 4

Conditional Formatting/Traffic LX style is not formatting correctly

  1. #1
    Registered User
    Join Date
    06-02-2014
    Posts
    2

    Conditional Formatting/Traffic LX style is not formatting correctly

    Hi All,
    I'm more than new at VBA, literally just started about 2 months ago in a class, and I didn't even know VBA existed before this class. So, I've created a workbook that has a command button, that takes you to a userform. The user chooses a month, picks a date on the calendar, and enters data into several text boxes. I then have code that goes to the appropriate month tab (one for each of the 12 mo), enters the date in the appropriate cell, and enters the data into the appropriate cells. More code that then calculates the percentage of actual data vs. goal data (so cell D4 = C4/B4, in percentage form).

    My question is, I've tried a few different ways to apply the conditional formatting of traffic light style to the percentage column (D4:D14), but it's not coming up correctly. It keeps coming out either mostly red or mostly green lights, even though you can clearly see that some of the cells are within that yellow color range.

    Here's my code below. I cobbled it together from recording a macro and looking at that, plus mashed together with pieces I've found on the internet. I would greatly appreciate anyone pointing out my idiocy and fixing this. I have been stumped on this all weekend and can't seem to figure out why it's not working.

    Thank you!!!
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 06-23-2014 at 11:41 PM. Reason: Added Code Tags

  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,946

    Re: Conditional Formatting/Traffic LX style is not formatting correctly

    Hi and welcome to the forum

    Why not use the built-in conditional formatting in excel?
    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
    Registered User
    Join Date
    06-02-2014
    Posts
    2

    Re: Conditional Formatting/Traffic LX style is not formatting correctly

    Hi there,
    Well, I thought I had to write the code to tell Excel once there was a value there to apply the conditional formatting. Is there code to just turn the conditional formatting "on"? Or should I go to each month tab, select the range, and apply the formatting by hand, before the user sees the workbook?

    I'm a super newbie at this whole thing, so I apologize if I'm asking obvious questions here.

  4. #4
    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,946

    Re: Conditional Formatting/Traffic LX style is not formatting correctly

    Or should I go to each month tab, select the range, and apply the formatting by hand, before the user sees the workbook?
    Yup, pretty much and from the sounds of it, maybe some of the other stuff you are programming with VBA could be done with native excel function?
    More code that then calculates the percentage of actual data vs. goal data (so cell D4 = C4/B4, in percentage form).
    Why not just have 1 data page that the user enters data into (below the previous entry), and then run all your cals etc on other sheets?

+ 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. Conditional Formatting- Traffic Lights - Using Formulas
    By Nikki Fox in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-21-2013, 10:50 AM
  2. Traffic Light Conditional Formatting
    By hzaz in forum Excel General
    Replies: 4
    Last Post: 05-01-2013, 02:10 PM
  3. Need help with traffic light conditional formatting icon set
    By jjospeh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 03:33 PM
  4. Conditional Formatting - Traffic light dates
    By zx561 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2012, 02:51 PM
  5. Traffic Lights - Conditional Formatting
    By Moe2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2012, 01:42 AM

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