You cannot get the sort results you want the way your data is entered due to way Excel processes the data.
You will have to either:
Break the times up into separate columns and sort ascending on the start time
e.g. A1 = 7am, B2 =9am -- then sort on column-A
Or . .
Leave the original column as is and use a helper column to provide a value on which to sort. This could be a formula such as:
Assuming row1 is header and value are text
=IF(MID(A2,2,1)="-",LEFT(A2,1),LEFT(A2,2))+0
This will return the first number and provide the means to get the sort result you want.
This bit of code will sort the sheet when the workbook is opened. It will have to be adapted per your requirements for sheet and range references.
Note: because the code executes when the file is opened, the data will already be sorted when you view the attachment. Manually rearrange the data in column-A, close the file and reopen it to see the sorting code at work.
Bookmarks