+ Reply to Thread
Results 1 to 6 of 6

macro for highlighting which will consider date

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    12

    macro for highlighting which will consider date

    Hello,

    could anyone pls help me with this:

    I am trying to write macro for highlighting 1 row which will depend on current day. For example for 9.12. it should highlight the row with ultimum of the previous month. (see attachment)

    I m sure that for lots of you this is really easy but I would appriciate any guidance how to do it.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: macro for highlighting which will consider date

    Your example makes no sense

    Are we saying that if today is in december then highlight the last day in November?
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    12-09-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    12

    Re: macro for highlighting which will consider date

    Thank you for your reply. I admit that I didnīt specify it correctly.

    But your assumption is right. The macro should work like this: if the date is between 1.1.2016 and 31.1.2016 then highlight 31.12.2015. If the date is between 1.2.2016 and 28.2.2016 then highlight 31.1.2016...

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: macro for highlighting which will consider date

    Conditional formatting will do that for you

    Select all the cells by clicking on the top left corner of your spreadsheet

    Click on Conditional formatting

    Select use formula to determine formatting

    Paste this formula in the window

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Click on Format and select the font and fill formatting that you want.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-09-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    12

    Re: macro for highlighting which will consider date

    Thank you very much!!!! But is it also possible with conditional formatting change the colour of the last two diigts in this already highlighted row?

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: macro for highlighting which will consider date

    Try this formula in conditional formatting.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Do not forget, You can apply more than one conditional formats.
    Last edited by mehmetcik; 12-09-2016 at 08:00 PM.

+ 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. [SOLVED] Highlighting Date
    By SeeMun in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-22-2016, 11:45 AM
  2. Highlighting row based on the date
    By mamuka12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2013, 02:22 PM
  3. [SOLVED] How Do I Write a Macro for Highlighting Rows Based on Date Criteria
    By TMack in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-21-2013, 11:15 AM
  4. Replies: 2
    Last Post: 02-06-2013, 12:13 AM
  5. Replies: 0
    Last Post: 02-05-2013, 07:51 AM
  6. Excel 2007 : Highlighting a Row with a Certain Date
    By Ormond2009 in forum Excel General
    Replies: 6
    Last Post: 03-29-2010, 03:02 PM
  7. Macro for date highlighting....
    By mauddib13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2005, 05:05 AM

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