Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I have an excel problem. I have the schedules of people but need to convert them to a very specific format for a CSV to upload to payroll.?

So in one column I have start time, and in another I have end time. These are entered at present as text in the format 8:00 AM.

So I need to take the start time and end time from two different columns and merge them into one 8 digit number. For example start time is 8:00 AM and finish time is 4:00 PM I need it to say 08001600

Update:

jzimmerman - thanks for your help but when I try the first step I cannot enter anything in "type"

1 Answer

Relevance
  • 6 years ago
    Favorite Answer

    This is assuming that column a is start time, column b is end time, and column c is blank. first, format columns a and b as special, and type in hhmm as your type. Format column C as text.<--(important) If you type in 8:00 am into column a it should switch it to 0800. if you type 4:00 pm into column b it should show up as 1600. Now, hit Alt-F11, double click sheet 1 and paste the code below. I would try this with a test sheet first as there is no undo for vba code. This worked on my end for what you wanted to do.

    Sub Macro1()

    For i = 1 To 200

    starttime = Cells(i, 1).Text

    endtime = Cells(i, 2).Text

    Cells(i, 3) = starttime & endtime

    Next i

    End Sub

Still have questions? Get your answers by asking now.