+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting - Fill colour and dates

  1. #1
    Registered User
    Join Date
    07-30-2016
    Location
    Eire
    MS-Off Ver
    Office 2011
    Posts
    7

    Conditional formatting - Fill colour and dates

    First post here. Here goes:

    I'm trying to reduce the amount of data I enter manually in an excel Parts List at work. I don't really have a clue how to code but what I'm trying to do in Excel might sound something like this in computer language (see attachment):

    If Cell B3 & D3 = fill colour green then>
    Value in Cell C3=Value in B3
    and
    D3=Todays Date (i.e. date I'm actually filling in the info)

    Alternatively if I enter a date in D3 (any date, could be 04/04/1916)

    If D3 = date entered then>
    C3 & D3 = Fill Colour Green
    and
    Value in B3 = Value in C3.

    Is it possible to do this in Conditional Formatting?
    Attached Files Attached Files
    Last edited by JTBS; 08-01-2016 at 11:59 AM.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: New to Conditional formatting

    Hi,
    Welcome to the forum.

    Please follow these steps....

    1) Select the range C3:D7

    2) Home Tab --> Conditional Formatting --> New Rule --> Select a rule type "Use a formula to determine which cells to format" --> In the formula box type the formula given below and click on Format to set the format of your choice --> OK --> OK

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    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: New to Conditional formatting

    JTBS welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    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

  4. #4
    Registered User
    Join Date
    07-30-2016
    Location
    Eire
    MS-Off Ver
    Office 2011
    Posts
    7

    Re: New to Conditional formatting

    Quote Originally Posted by sktneer View Post
    Hi,
    Welcome to the forum.

    Please follow these steps....

    1) Select the range C3:D7

    2) Home Tab --> Conditional Formatting --> New Rule --> Select a rule type "Use a formula to determine which cells to format" --> In the formula box type the formula given below and click on Format to set the format of your choice --> OK --> OK

    Please Login or Register  to view this content.
    Hi,

    I've followed the steps and tried the code you posted but I'm not getting anything. Could you have a look at the attachment and see if I'm doing something wrong?

    Cheers.
    Attached Files Attached Files

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Conditional formatting - Fill colour and dates

    Refer to the attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-30-2016
    Location
    Eire
    MS-Off Ver
    Office 2011
    Posts
    7

    Re: Conditional formatting - Fill colour and dates

    Quote Originally Posted by sktneer View Post
    Refer to the attached.
    Am I right in saying this code (=AND($B3=$C3,ISNUMBER($D3)) requires me to enter quantity delivered and date?

    Is it possible to just enter the date and then the value in cell B3 will appear in C3 and also cause C3 and D3 to have fill colour green.

    Alternatively could I just enter the quantity delivered which would cause the date to appear in D3 and C3 & D3 to have fill colour green.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Conditional formatting - Fill colour and dates

    Your description is a bit confusing.

    If you want the column D to populate automatically with the current date once you input the quantity received in col. C, that can be achieved with a VBA code.
    In the attached macro enabled file, once you input e.g. quantity received in C3, the current date in D3 will be populated automatically and C3 and D3 will be highlighted as per the conditional formatting rules.

    Since this is a macro enabled file, you will need to enable the macro when prompted.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-30-2016
    Location
    Eire
    MS-Off Ver
    Office 2011
    Posts
    7

    Re: Conditional formatting - Fill colour and dates

    Quote Originally Posted by sktneer View Post
    Your description is a bit confusing.

    If you want the column D to populate automatically with the current date once you input the quantity received in col. C, that can be achieved with a VBA code.
    In the attached macro enabled file, once you input e.g. quantity received in C3, the current date in D3 will be populated automatically and C3 and D3 will be highlighted as per the conditional formatting rules.

    Since this is a macro enabled file, you will need to enable the macro when prompted.
    Apologies, I guess I'm not good at explaining this sort of stuff. That's exactly what I'm looking for. thanks very much.

    Now I need to put this code in a parts list I use at work. Is it possible for you to go through that VBA code step by step or is it something difficult? Would it be a case of copying an pasting in that code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 3 And Target.Row > 1 Then
    If Target <> "" And IsNumeric(Target) Then
    Target.Offset(0, 1) = Date
    Else
    Target.Offset(0, 1) = ""
    End If
    End If
    End Sub

    Could you recommend a basic VBA resource online so I could start learning and eventually be able to do stuff like this myself.
    Last edited by JTBS; 08-07-2016 at 04:56 AM.

+ 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 Removing Previous Conditional Formatting?
    By CravingGod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 01:02 PM
  2. Replies: 6
    Last Post: 01-08-2016, 06:44 PM
  3. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  4. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  5. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  6. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

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