Help sorting by dates

zach454

New Member
Joined
Apr 25, 2011
Messages
28
I am putting a list togther of employees in which I am putting their hire date in along with some other information and I am trying to get it to sort by the hire date. Excel does a nice job of automatically doing this in excel 2010, but at work on our excel 2003-2007, the macro I created on excel 2010 won't work. So here is just a small info of what I need sorted:


<TABLE style="WIDTH: 519pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=690 x:str><COLGROUP><COL style="WIDTH: 94pt; mso-width-source: userset; mso-width-alt: 4571" width=125><COL style="DISPLAY: none; mso-width-source: userset; mso-width-alt: 512" width=0><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 2pt; mso-width-source: userset; mso-width-alt: 73" width=2><COL style="WIDTH: 89pt; mso-width-source: userset; mso-width-alt: 4352" width=119><COL style="WIDTH: 2pt; mso-width-source: userset; mso-width-alt: 73" width=2><COL style="WIDTH: 65pt; mso-width-source: userset; mso-width-alt: 3145" width=86><COL style="DISPLAY: none; mso-width-source: userset; mso-width-alt: 1097" width=0><COL style="WIDTH: 105pt; mso-width-source: userset; mso-width-alt: 5120" width=140><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 17.25pt; mso-height-source: userset" height=23><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 94pt; HEIGHT: 17.25pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 height=23 width=125>Employee</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=0></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 66pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=88>Clock #</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 2pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=2></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 89pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl68 width=119>Hire Date</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 2pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=2></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 65pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=86 x:str="Shift ">Shift </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=0></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 105pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=140>Position</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 96pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl69 width=128 colSpan=2>Area</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Lessly Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>33331</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66 x:num="39629">6/30/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>SUO</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Gearing</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Gary Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>13133</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>3/29/2006</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>SUO</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Gearing</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Gray Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>12132</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66 x:num="39657">7/28/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>TEAM LEAD</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Shaft</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Charles Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>11333</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>5/27/1997</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>SUO</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Shaft</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Josh Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>44232</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>7/21/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>TEAM LEAD</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Gearing</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Danny Smith</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>12344</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>4/25/2005</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>SUO</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3">Gearing</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3"></TD></TR></TBODY></TABLE>

I need to sort by Hire date (for senority) but keep all the other columns connected to the person. I'm stuck on this big issue. Thanks for any help!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It would help if you post your code, but in any case, dates are numbers and sort in ascending or descending order no matter the version. Something else is going on maybe, but on the face of it there should be no problem. Could be an argument in the 2010 code not supported in an earlier version you are trying to run it in.
 
Upvote 0
Well when I did it at home on excel 2010, I just recorded a macro, so it was all coded like this:

ActiveWorkbook.Worksheets("Sorting").AutoFilter.Sort.SortFields.Add Key:= Range("E1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= xlSortNormal
With ActiveWorkbook.Worksheets("Sorting").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

When I brought it here, it error's out 'SortOn:=xlSortOnValues'. So I went to record the macro again and the autofilter feature just isn't the same and I can't produce the same result. I can sort JUST the date list but then it doesn't match up with the employee that it should. So my only other option I could think of was to use vba code, but I'm not that good at it yet to achieve this.

Thanks
 
Upvote 0
Along the same lines as Tom, I think you may have recorded and modified bits in Excel2010, that are not supported in 2003. Have you tried recording the sort in 2003 and see what differences there are? By example, I recorded this (and modified a bit), which should work fine in following versions.

Sheet3

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Arial,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 89px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 90px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 81px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD><TD>G</TD><TD>H</TD><TD>I</TD><TD>J</TD><TD>K</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="BORDER-TOP: #666699 2px solid; BORDER-LEFT: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Employee</TD><TD style="BORDER-TOP: #666699 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #333399"> </TD><TD style="BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Clock #</TD><TD style="BORDER-TOP: #666699 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #333399"> </TD><TD style="BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Hire Date</TD><TD style="BORDER-TOP: #666699 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #333399"> </TD><TD style="BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Shift </TD><TD style="BORDER-TOP: #666699 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #333399"> </TD><TD style="BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Position</TD><TD style="BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399">Area</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-TOP: #666699 2px solid; COLOR: #ffffff; FONT-FAMILY: Calibri; BACKGROUND-COLOR: #333399"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Charles Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">11333</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">5/27/1997</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">SUO</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Shaft</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Danny Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">12344</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">4/25/2005</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">SUO</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Gearing</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Gary Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">13133</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">3/29/2006</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">SUO</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Gearing</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Lessly Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">33331</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">6/30/2008</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">SUO</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Gearing</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Josh Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">44232</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">7/21/2008</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">TEAM LEAD</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 1px solid; FONT-FAMILY: Calibri">Gearing</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 1px solid"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-LEFT: #666699 2px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri">Gray Smith</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">12132</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">7/28/2008</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri; TEXT-ALIGN: right">2</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Verdana"> </TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri">TEAM LEAD</TD><TD style="BORDER-RIGHT: #666699 1px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Calibri">Shaft</TD><TD style="BORDER-RIGHT: #666699 2px solid; BORDER-BOTTOM: #666699 2px solid; FONT-FAMILY: Verdana"> </TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4

Rich (BB code):
Sub Macro1()
 
    With ActiveSheet    '<---Change to suit
        .Range("A1:K7").Sort Key1:=.Range("E2"), _
                             Order1:=xlAscending, _
                             Header:=xlYes, _
                             OrderCustom:=1, _
                             Orientation:=xlTopToBottom
    End With
End Sub
Hope that helps,

Mark
 
Upvote 0
I put in that code:

With Sheets("SORTING") '<---Change to suit
.Range("A1:K200").Sort Key1:=.Range("E2"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
Orientation:=xlTopToBottom
End With


and this is what I get when it runs through?

<TABLE style="WIDTH: 423pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=562 x:str><COLGROUP><COL style="WIDTH: 94pt; mso-width-source: userset; mso-width-alt: 4571" width=125><COL style="DISPLAY: none; mso-width-source: userset; mso-width-alt: 512" width=0><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 2pt; mso-width-source: userset; mso-width-alt: 73" width=2><COL style="WIDTH: 89pt; mso-width-source: userset; mso-width-alt: 4352" width=119><COL style="WIDTH: 2pt; mso-width-source: userset; mso-width-alt: 73" width=2><COL style="WIDTH: 65pt; mso-width-source: userset; mso-width-alt: 3145" width=86><COL style="DISPLAY: none; mso-width-source: userset; mso-width-alt: 1097" width=0><COL style="WIDTH: 105pt; mso-width-source: userset; mso-width-alt: 5120" width=140><TBODY><TR style="HEIGHT: 17.25pt; mso-height-source: userset" height=23><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 94pt; HEIGHT: 17.25pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 height=23 width=125>Employee</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=0> </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 66pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=88>Clock #</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 2pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=2> </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 89pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl68 width=119>Hire Date</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 2pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=2> </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 65pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=86 x:str="Shift ">Shift </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=0> </TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: #333399; WIDTH: 105pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl67 width=140>Position</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Zach J</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>43434</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66 x:num="39629">6/30/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>Production Manager</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Nick P</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>34433</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66 x:num="39657">7/28/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>TEAM LEAD</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Manuel C</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>22222</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>10/12/2009</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>FLEX</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Kyle G</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>33333</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>10/20/2008</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>SUO</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 height=20>Eric M</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65 x:num>23233</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl66>11/5/1997</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>2</TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65></TD><TD style="BORDER-BOTTOM: #e0dfe3; BORDER-LEFT: #e0dfe3; BACKGROUND-COLOR: transparent; BORDER-TOP: #e0dfe3; BORDER-RIGHT: #e0dfe3" class=xl65>TEAM LEAD</TD></TR></TBODY></TABLE>


So as you can see the dates aren't correct? I'm confused, you can get it to work but mine won't? It does move them around a bit, but not liek it should.
 
Upvote 0
So if I make a new list and go to sort it will sort it correctly with the code you gave me. But with my list that gets populated by my vba it will not work. At first the column was formatted as 'Custom' so then I added the DateValue( ) as it gets populated and now the cells are formated to 'Date' but it still won't sort correctly....For each employee they have their own sheet with the date in date format and when I start my userform, it cycles through each date and poplates the Sorting sheet. Heres the code on start up:

Sub Start_up()
' Counts all the sheets and populates the list
Dim SheetNames() As Variant 'Dynamic Array
Dim SheetCount As Long
Dim i As Long
Dim NextRow, sum, sum1, sum2, s, f

' Counts total number of Sheets
SheetCount = ActiveWorkbook.Sheets.Count

' Clears Sorting Page for repopulation
Sheets("Sorting").Select
Range("A2:I200").Delete
Range("A2:I200").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("E2:E200").Select
Selection.NumberFormat = "m/d/yyyy"
Range("A2").Select
' Starting at 5 removes "Main"/"Sorting" from the list
ReDim SheetNames(5 To SheetCount) 'Defines number of elements for array

s = 1
f = 1
For i = 5 To SheetCount
SheetNames(i) = ActiveWorkbook.Sheets(i).Name
DocForm.ListOfEmployees.AddItem SheetNames(i)
DocForm.ListOfClock.AddItem Sheets(i).Range("C2")
DocForm.ListOfHire.AddItem Sheets(i).Range("E2")
DocForm.ListOfShift.AddItem Sheets(i).Range("G2")
DocForm.ListOfPosition.AddItem Sheets(i).Range("I2")
' Fill's sorting page with all employee's
NextRow = Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Sorting").Range("A" & NextRow) = SheetNames(i)
Sheets("Sorting").Range("C" & NextRow) = Sheets(i).Range("C2")
Sheets("Sorting").Range("E" & NextRow) = Sheets(i).Range("E2")
Sheets("Sorting").Range("G" & NextRow) = Sheets(i).Range("G2")
Sheets("Sorting").Range("I" & NextRow) = Sheets(i).Range("I2")

' Cbo DropDown
DocForm.Employee.AddItem SheetNames(i)

' Gets total number of Employee's
DocForm.Total.Caption = i - 4

If Sheets(i).Range("G2") = "1" Then
sum1 = sum1 + f
DocForm.First.Caption = sum1
ElseIf Sheets(i).Range("G2") = "2" Then
sum2 = sum2 + s
DocForm.Second.Caption = sum2
End If
Next i
End Sub


What am I doing wrong?? Any help will be greatly appreciated!
 
Upvote 0
Ok GOT IT!!! Thanks a lot guys for your help, couldn't have doen it without you. Turns out I needed to use CDate() to convert value back to a date, for some reason excel changes it when vba moves it?

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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