+ Reply to Thread
Results 1 to 8 of 8

vba not identifying date that is generated by a formula question

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    vba not identifying date that is generated by a formula question

    Good Evening! I was hoping someone could help me possibly edit this code so it would recognize dates which are generated via a formula. The code works great if the date is in a format like 01/17/15, but if the date 01/17/15 as an example is generated by a formula it isn't recognized. I'll try and set up and attach a sample workbook but currently the original is fairly complex and it may take a little bit of time. So in the mere chance someone can recognize the issue here is the code that I'm currently using:
    Please Login or Register  to view this content.
    Essentially this code takes certain Holiday dates from the "Holiday" worksheet from cells A2 thru A12 and then puts an "H" on any monthly titled worksheet directly underneath the same date. The "H" would go in Row 2 directly underneath the same date which is now formula based but in Row 1. Hope this makes sense. The formula that generates the date looks like this:
    Please Login or Register  to view this content.
    Thanks for your time and advice!
    Attached Files Attached Files
    Last edited by lilsnoop; 07-28-2015 at 11:44 PM. Reason: added sample file

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: vba not identifying date that is generated by a formula question

    Give this a try. It should be date format independent.

    Please Login or Register  to view this content.
    It's not tested. I cannot load an .xlsb file with My Excel 2003.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: vba not identifying date that is generated by a formula question

    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    Re: vba not identifying date that is generated by a formula question

    Hello AlphaFrog! Thanks for looking at this for me. I'm getting the following error message (see attached jpg file)
    Attached Images Attached Images

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    Re: vba not identifying date that is generated by a formula question

    Thanks protonLeah that worked perfectly!! Thank you both so much!

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba not identifying date that is generated by a formula question

    Try this modification
    Please Login or Register  to view this content.
    Last edited by YasserKhalil; 07-28-2015 at 11:49 PM.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: vba not identifying date that is generated by a formula question

    Missing a space for what it's worth.

    Dim destSh As Worksheet
    .....^

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba not identifying date that is generated by a formula question

    Here's AlphaFrog's Code after little fix
    Please Login or Register  to view this content.

+ 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. Question about identifying a value based on a range.
    By rgrocks in forum Excel General
    Replies: 3
    Last Post: 04-17-2014, 01:09 PM
  2. [SOLVED] Forumula generated date column not sorting with filter
    By tlclark616 in forum Excel General
    Replies: 6
    Last Post: 01-02-2013, 11:15 AM
  3. Excel - E-mail automatically generated depending on date?
    By ShearsJ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 12:00 PM
  4. Dynamically generated data validation question
    By francisco in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2012, 06:15 PM
  5. SUMIFS with User generated date range?
    By magicbob007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2011, 02:22 PM
  6. VBA Code not Matching an inputted Date to Generated Calender
    By edelauna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2008, 11:26 AM
  7. Date Formula Question: date+1 year formatting
    By sheldons86 in forum Excel General
    Replies: 1
    Last Post: 07-30-2008, 04:41 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