+ Reply to Thread
Results 1 to 3 of 3

Add missing Time in cells with a date

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010 Mac
    Posts
    2

    Add missing Time in cells with a date

    Hey everyone,

    I am trying to add a missing time to cells that have an existing date.

    Example: Setup Start
    7/15/13 7/15/13
    7/15/13 0:05 7/15/13 0:05
    7/15/13 7:00 7/15/13 7:00
    7/16/13 7/16/13

    I need to add "12:00" to the date without times in them. I have searched the forums and can find several macros to find the cells or to add the "12:00" to every cell. I can't seem to find a macro to add the "12:00" to the end of the date in the cells that are only missing a time.

    This is the closest that I have come:

    Sub x()

    Dim r As Excel.Range

    For Each r In Selection

    If r.Value = vbNullString Then
    r.Value = ":"
    ElseIf InStr(UCase$(r.Value), ":") = 0 Then
    r.Value = "12:00" & r.Value
    End If
    Next

    End Sub


    but it adds the "12:00" to the beginning and I do not know script enough to manipulate. I searched for the ":" and inserted if none was found.

    Please help.

    Thanks
    Chad

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Add missing Time in cells with a date

    Give this a try:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    08-22-2013
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010 Mac
    Posts
    2

    Re: Add missing Time in cells with a date

    That worked perfectly!!!

    Thanks so much!

    Chad

+ 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. Excel Macro to find missing dates and insert missing date as blank row
    By JevaMarie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 11:08 AM
  2. Replies: 2
    Last Post: 04-10-2013, 11:17 AM
  3. Inserting rows for Missing Date/ Time data (Excel 2007)
    By mzalikhan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2011, 08:57 PM
  4. Replies: 2
    Last Post: 11-25-2006, 08:50 AM
  5. [SOLVED] how do I format cells to change date and time to just date
    By bondam in forum Excel General
    Replies: 3
    Last Post: 07-03-2005, 09:05 AM

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