Macro convert time

youra6

Board Regular
Joined
Mar 31, 2014
Messages
95
So I work with a bunch of smarties who appended a AM/PM to military time.

Ie: 14:23 PM

What is a macro that can take times in the above format, and convert it into 12/hour time? (ie: 2:23 PM)
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

BobUmlas

Well-known Member
Joined
Mar 14, 2002
Messages
1,170
format(left(activecell.Value,instr(activecell.Value," ")-1),"h:mm AM/PM")
 

Watch MrExcel Video

Forum statistics

Threads
1,109,383
Messages
5,528,385
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top