Sandy
Sandy

Reputation: 49

Vba Macro that addes new column then change the cells into time format

I am very new to VBA macro excel.... the macro created adds a new column named "Response Time" then it subtracts 2 columns namely "Find Full Out Gate at Inland or Interim Point (Destination)_actual" and "Full Out Gate at Inland or Interim Point (Destination)_recvd" and put the subtraction (output) value in that new columned named Response time... Macro is executing properly, however, the newly added column i.e. "Response Time" should be in "HH:MM:SS" format here the output is showing weird. So am trying to fix the newly added column cells format in "hh:mm:ss" format.... I will paste the code below and also the excel screen for ref

[![Response Time][1]][1]

In the above screenshot, Macro has created column "Response Time and subtracted column L2-K2... However, the output in column M shows "1/0/1900" which is weird wherein I want to see the only output as "6:21"

Upvotes: 0

Views: 93

Answers (1)

BigBen
BigBen

Reputation: 50042

If you are looking to format the entire column, then perhaps:

cl.Offset(,1).EntireColumn.NumberFormat = "hh:mm:ss"

Upvotes: 1

Related Questions