Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro to change time format....
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can we change the format for pre set footers like date, time etc. | Excel Discussion (Misc queries) | |||
change text format to time | Excel Worksheet Functions | |||
Change time format from :0 to 0:0 | Excel Worksheet Functions | |||
macro to change text to time | Excel Worksheet Functions | |||
change format for time value | Excel Discussion (Misc queries) |