+ Reply to Thread
Results 1 to 5 of 5

Max Date for a column not working

  1. #1
    Registered User
    Join Date
    12-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    34

    Max Date for a column not working

    I have not been having any luck trying to get the below code working. It always returns 0 if not defined as a date or 12:00:00 AM if defined as a date. Is it because I don't have contiguous data?

    Dim Max_date As Date
    Max_date = Application.Worksheets(Sheet2).WorksheetFunction.Max(Range("a:a"))
    Debug.Print Max_date

    Result: 12:00:00 AM


    column a.png

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Max Date for a column not working

    Try change to
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    34

    Re: Max Date for a column not working

    Thanks much as that worked.

    I thought I could use the same idea to find the start date but now that isn't working. Probably something very simple but no luck figuring it out. All I want to achieve is to find the row for today or monday if today is a sunday, and the row for the last date in the column. Seems so simple but it has been kicking my butt.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Max Date for a column not working

    Try change to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    34

    Re: Max Date for a column not working

    That did the trick. Thanks much.

+ 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] fill between two date according to working day and non working day , holidays
    By mazan2010 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-24-2017, 01:39 PM
  2. "Date and Time difference" column not working
    By Ochimus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2017, 07:53 PM
  3. [SOLVED] Large & Small Functions Not Working If A Column Has Multiples Of The Same Date
    By Philb1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2015, 07:03 PM
  4. Replies: 3
    Last Post: 05-14-2015, 07:32 AM
  5. Replies: 1
    Last Post: 05-26-2014, 03:46 AM
  6. Date/Month/Year formatting for column "c" not working for me...
    By Rabbitstew in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-02-2013, 10:37 PM
  7. Previous working days date (Mon-Fri working week).
    By intothewild in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2011, 01:00 PM

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