title: VBA Convert and combine date and time
body: <p>I am new to VBA and am working an a macro that will help me transform call records into something useful for analysis. </p>
  
  <p>Column E contains the Date of Call which is formatted YYYYMMDD. I need to convert to MM/DD/YYYY. (i.e. 20140101 convert to 1/1/2014)</p>
  
  <p>Column F contains the Time of Call which is formatted HHMMSS or HMMSS depending on whether the hour has two digits or one. I need to convert to HH:MM:SS (i.e. 130101 or 90101 which needs to convert to 13:01:01 and 9:01:01, respectively). Because the hour is missing the tens digit if the value is below ten, (below) I have added a "0" to the beginning of the value so I can use the date function. </p>
  
  <p>I currently enter the the following formula in Column K and autofill until the end of the range:</p>
  
  <blockquote>
    <p>=DATE(LEFT(E2,4),MID(E2,5,2),RIGHT(E2,2))+TIME(LEFT(IF(LEN(F2)=5, 0&amp;F2, F2),2),MID(IF(LEN(F2)=5, 0&amp;F2, F2),3,2),RIGHT(IF(LEN(F2)=5, 0&amp;F2, F2),2))</p>
  </blockquote>
  
  <p>The formula results in a value like "1/1/2013 13:01:01". </p>
  
  <p>Can someone help me write the VBA code to automate this process?</p>
  
  <p>Thank you.</p>