+ Reply to Thread
Results 1 to 4 of 4

Macro for Date Adjusting

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macro for Date Adjusting

    Hello members of the Excel Help Forum,

    I am looking to create a VB instruction on my workbook that will convert dates.

    Here is an example:
    feb_mar_PDC_report.xlsx

    I wanted to create a macro that would be activated by selecting a row and clicking a button.
    This macro would take all dates in format MONTH/DAY/YEAR HH:MM:SS and add 3 hours to it, correctly assessing days change in case of a timing going past midnight.

    Also, the macro should be able to ignore a cell without a date; with a value such as "N/A" or a name.

    If anyone could help or even just point me in the right direction, I'd be very grateful.
    Thank you very much for your attention.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Macro for Date Adjusting

    3/24 = 3 hrs
    If you had a date and time in A1 the formula in B1 to add 3 hrs would be A1+3/24

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for Date Adjusting

    Hello Dave,

    Thank you for replying.

    However, there are multiple columns with timings. Adding one more column for each timing to do the conversion would be impractical.

    Is there any way to make this conversion VB-based?
    A button that would change all the timings in the row to 3 hours forward.

  4. #4
    Registered User
    Join Date
    12-26-2011
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for Date Adjusting

    Excuse me, I'm bumping this just this once.

+ 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