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
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