+ Reply to Thread
Results 1 to 7 of 7

How to create lsit of datetime?

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to create lsit of datetime?

    Hi,

    I really not good in macro. Need anyone to help me on this.
    How to make macro to create a list of datetime?
    I have StartDate in A2 cell and EndDate in B2 cell.
    The list of datetime will start from the StartDate and end with EndDate.


    Example:
    StartDate : 2-Feb-2013
    EndDate : 5-Feb-2003

    Result should be like this:
    2-Feb-2003 12:00:00 AM
    2-Feb-2003 1:00:00 AM
    2-Feb-2003 2:00:00 AM
    .
    .
    2-Feb-2003 11:00:00 PM
    3-Feb-2003 12:00:00 AM
    3-Feb-2003 1:00:00 AM
    3-Feb-2003 2:00:00 AM
    .
    .
    3-Feb-2003 11:00:00 PM
    4-Feb-2003 12:00:00 AM
    4-Feb-2003 1:00:00 AM
    4-Feb-2003 2:00:00 AM
    .
    .
    4-Feb-2003 11:00:00 PM
    5-Feb-2003 12:00:00 AM
    5-Feb-2003 1:00:00 AM
    5-Feb-2003 2:00:00 AM
    .
    .
    5-Feb-2003 11:00:00 PM


    Please help me...

    Thank you

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to create lsit of datetime?

    Hi nhalina,

    welcome to the forum.

    Do you need data list as 11 PM, 12 AM, 1 AM , 2 AM OR,
    do you need every hour difference in data list starting from startdate till end date ?


    Also, try looking at Home -> Fill option. thanks.

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: How to create lsit of datetime?

    Pl see the attached file with formula.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to create lsit of datetime?

    Hi DILIPandey,

    The StartDate in A2 cell and EndDate in B2 cell format is dd/mm/yyyy.
    I need result to show a list of one hour interval starting StartDate 12:00:00 AM until EndDate 11:00:00 PM.
    How to make macro to create a list?


    Hi kvsrinivasamurthy,

    Where can I find the formula?



    Thank you

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to create lsit of datetime?

    Hi nhalina,

    Used below macro in the attached file:-
    Please Login or Register  to view this content.
    see attached:- list of date time with 1 hour gap.xlsm


    Regards,
    DILIPandey
    <click on below * if this helps>

  6. #6
    Registered User
    Join Date
    04-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to create lsit of datetime?

    Thank a lot DILIPandey!!!! it works!!!!!

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to create lsit of datetime?

    you are welcome nhalina.... cheers


    suggest you to mark this thread as [SOLVED].. Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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