+ Reply to Thread
Results 1 to 11 of 11

Strikethrough code to activate when end date is past.

  1. #1
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile Strikethrough code to activate when end date is past.

    Hi Guys,

    I have this code below, which someone from this forum kindly kindly gave to me for my Worksheet code. What it does is check the value in a dropdown list in column I and if it says "Cancelled" then strikethrough columns A-K of that row.

    What I wanted to know is this, in cell N2 has the formula to show todays date. In column D9 onwards is an end date. How can I amend the code below so that it also checks to see if the date in Column D9 onwards is greater than N2 and if so strikethrough columns A-K in that row?

    Would it be in the form of an OR statement in the code below?

    Thanks in advance.


    Please Login or Register  to view this content.
    Last edited by Zyphon; 11-24-2008 at 12:59 PM. Reason: Thread now solved.
    Best Regards.

    Michael
    -----------------------------------
    Windows Vista, Microsoft Office 2007

  2. #2
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile

    Bump. No response.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    Not an OR but more IF THEN tests

    Please Login or Register  to view this content.
    If not as expected post small example file.

    Can you not use Conditional formatting for this?
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile

    Hi Andy,

    Thanks for your help, unfortunately that added code did not work and I have used up the allocated 3 Coditional Formatting.

    Maybe we need to change the code slightly so that it looks at the range ("D9:D34"). I have saved the code in the worksheet code and have attached it so that you can see what I am trying to achieve.

    Thanks again for your support.
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    I still not sure which cell should be check for a date when a cell in column I is changed.

    But this checks the date on the same row.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile

    Hi Andy thanks again for your help.

    Basically if the end date is cells D9-D34 has passed the 'Today's Date' formula in N2 then I wanted to 'strikethrough' Columns A-K, so that I can tell which dates have passed and which ones have not.

    I hope I have managed to explain myself correctly, appogies in advance if I am still confusing you.

    Can this be done?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    This will strike through records that have end date older than date in N2.

    Please Login or Register  to view this content.
    Maybe this would be best done only when the workbook is opened rather then within the change event?

  8. #8
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile

    Hi Andy,

    Once again thank you for all of your help. I have added your last piece of code to my original code, I just wanted to check with you if I have placed it in the right place, it works fine but my VBA knowledge is serverely limited and I don't know if it needs tidying up or not.

    If it is fine then I can make this thread solved.

    Please Login or Register  to view this content.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    Where you have placed it the code will run everytime something in column 9 changes.
    If you are okay with that then if it works your done.

    But you may only want to run the code once, when the workbook opens.
    In which case you need to move the code out of the Worksheet_Change event and place it in a routine within a standard code module. The add a line to the Workbook_Open event that calls the new routine.

  10. #10
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Thumbs up

    Quote Originally Posted by Andy Pope View Post
    Where you have placed it the code will run everytime something in column 9 changes.
    If you are okay with that then if it works your done.

    But you may only want to run the code once, when the workbook opens.
    In which case you need to move the code out of the Worksheet_Change event and place it in a routine within a standard code module. The add a line to the Workbook_Open event that calls the new routine.
    Hi Andy thanks for that top tip, I did not konw of the Workbook_Open event. I shall do this and that should be fine.

    Again thank you so much for sparing the time to help me with my problem, I can now mark it solved.

  11. #11
    Registered User
    Join Date
    12-27-2012
    Location
    Malta
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Strikethrough code to activate when end date is past.

    how can i have a specific row put on strike through when I choose a "complete" task from a specific table

+ 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