![]() |
Macro to change time format....
1 Attachment(s)
Hi, please see attached....
I need a macro to put the times into 'hh:mm' format. At the minute some are 'h:mm' and they are all in text format. Is there a way to run a macro on the times to change all to 'hh:mm'? Thanks Neil |
Macro to change time format....
Neil,
Select all the cells that need to be changed and run the macro below. HTH, Bernie MS Excel MVP Sub ChangeTimeStringsToTimes() Dim myC As Range For Each myC In Selection myC.Value = TimeValue(myC.Value) myC.NumberFormat = "hh:mm" Next myC End Sub "neilcarden" wrote in message ... Hi, please see attached.... I need a macro to put the times into 'hh:mm' format. At the minute some are 'h:mm' and they are all in text format. Is there a way to run a macro on the times to change all to 'hh:mm'? Thanks Neil +-------------------------------------------------------------------+ |Filename: Whereabouts2.zip | |Download: http://www.excelbanter.com/attachment.php?attachmentid=104| +-------------------------------------------------------------------+ -- neilcarden |
All times are GMT +1. The time now is 05:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com