Colon in input cell creating trouble

flyfisher65

New Member
Joined
Aug 7, 2011
Messages
3
in VBA
I have written a macro that sorts data by time. I have a worksheet, in which each line corresponds to an individual. the line then has several time periods, and data for those time periods. example:

Person 1: [1200 x x x x][ 1300 y y y y][1400 z z z z]
Person 2: [15:00 x x x x ][12:00 y y y y ][16:00 z z z z]
I have written a the macro to sort the times in incremental order (like "person 1") when they are not already (like "person 2") the problem is that some of the times have colons in them (like "person 2" in example) and when the program sorts them they come out as weird decimals. (0.67.. or something like that). Does anyone know why this is? all the data types i used were variants, and i used the sort function built into excel (by printing it to a new worksheet and then reading it back in).
Thanks in advance
-Lewis
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top