Hello,
I have a small left to right sort as part of a loop in a macro that I don't know how to change the format of the cells for, so it sorts by the first digit. There are hidden cells but they don't seem to affect the sort.
The sort includes blank/empty cells in this case but will have data in some cases, so the loop needs to include them.
This is the code and result, Col 21-23 relevant.
ActiveCell.Offset(-1, -9).Range("A1:G1").Select
Selection.NumberFormat = "0"
With ActiveSheet.sort
.SortFields.Clear
.SortFields.Add Key:=ActiveCell. _
Range("A1:G1"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
.SetRange ActiveCell.Range("A1:G1")
.Header = xlGuess
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
<TABLE style="WIDTH: 361pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=481><COLGROUP><COL style="WIDTH: 97pt; mso-width-source: userset; mso-width-alt: 4608" width=130><COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1024" width=29><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 995" width=28><COL style="WIDTH: 25pt; mso-width-source: userset; mso-width-alt: 1166" width=33><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1024" width=29><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 995" width=28><COL style="WIDTH: 29pt; mso-width-source: userset; mso-width-alt: 1365" width=38><COL style="WIDTH: 18pt; mso-width-source: userset; mso-width-alt: 853" span=3 width=24><COL style="WIDTH: 18pt; mso-width-source: userset; mso-width-alt: 853" width=24><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1052" width=30><TBODY><TR style="HEIGHT: 16.05pt; mso-height-source: userset" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 97pt; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 height=21 width=130 align=right>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 30pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=40 align=right>9</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=29 align=right>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 21pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=28 align=right>11</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 25pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=33 align=right>12</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=29 align=right>17</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 21pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=28 align=right>18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 29pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=38 align=right>19</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>23</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>25</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>27</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=30 align=right>29</TD></TR><TR style="HEIGHT: 12.9pt; mso-height-source: userset" height=17><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; HEIGHT: 12.9pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70 height=17>Description</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Desn</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Style</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Color</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Loc</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl73>Status</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl74>Dec</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl72>Cncl</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L1</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L3</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L4</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: #abeb1d; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl76>SET</TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>HIBISCUS SURF</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>6079</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>177</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>WK</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>HIBISCUS SURF</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>6079</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>177</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>WK</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 1" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl88></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl90></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: #5bdfa0; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl93></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>BH MEDALLION</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>5319</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>279</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>HI</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>5</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>BH MEDALLION</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>5319</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>279</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>HI</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>5</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR></TBODY></TABLE>
What perplexes me the most is even with the format change in the macro, and the cells say 'number' when checking the format manually, it still sorts as text.
Thanks for any help,
Kendel, excel 2007
I have a small left to right sort as part of a loop in a macro that I don't know how to change the format of the cells for, so it sorts by the first digit. There are hidden cells but they don't seem to affect the sort.
The sort includes blank/empty cells in this case but will have data in some cases, so the loop needs to include them.
This is the code and result, Col 21-23 relevant.
ActiveCell.Offset(-1, -9).Range("A1:G1").Select
Selection.NumberFormat = "0"
With ActiveSheet.sort
.SortFields.Clear
.SortFields.Add Key:=ActiveCell. _
Range("A1:G1"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
.SetRange ActiveCell.Range("A1:G1")
.Header = xlGuess
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
<TABLE style="WIDTH: 361pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=481><COLGROUP><COL style="WIDTH: 97pt; mso-width-source: userset; mso-width-alt: 4608" width=130><COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1024" width=29><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 995" width=28><COL style="WIDTH: 25pt; mso-width-source: userset; mso-width-alt: 1166" width=33><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1024" width=29><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 995" width=28><COL style="WIDTH: 29pt; mso-width-source: userset; mso-width-alt: 1365" width=38><COL style="WIDTH: 18pt; mso-width-source: userset; mso-width-alt: 853" span=3 width=24><COL style="WIDTH: 18pt; mso-width-source: userset; mso-width-alt: 853" width=24><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1052" width=30><TBODY><TR style="HEIGHT: 16.05pt; mso-height-source: userset" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 97pt; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 height=21 width=130 align=right>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 30pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=40 align=right>9</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=29 align=right>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 21pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=28 align=right>11</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 25pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=33 align=right>12</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=29 align=right>17</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 21pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=28 align=right>18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 29pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=38 align=right>19</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>23</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>25</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 18pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=24 align=right>27</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 22pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl69 width=30 align=right>29</TD></TR><TR style="HEIGHT: 12.9pt; mso-height-source: userset" height=17><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; HEIGHT: 12.9pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70 height=17>Description</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Desn</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Style</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Color</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl70>Loc</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl73>Status</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl74>Dec</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl72>Cncl</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L1</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L3</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: lime; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl75>L4</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: #abeb1d; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl76>SET</TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>HIBISCUS SURF</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>6079</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>177</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>WK</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>HIBISCUS SURF</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>6079</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>177</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>WK</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/21</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>10</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 1" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl88></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl90></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: #5bdfa0; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl93></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>BH MEDALLION</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>5319</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>279</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>HI</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>5</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR><TR style="HEIGHT: 16.05pt; mso-height-source: userset; mso-outline-level: 2" height=21><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 16.05pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl86 height=21>BH MEDALLION</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>5319</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>847</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>279</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>HI</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl91>15</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl87>2</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl89>9/18</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>8</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92>5</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl92></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; FONT-FAMILY: Calibri; COLOR: windowtext; FONT-SIZE: 11pt; BORDER-TOP: #ffffff; FONT-WEIGHT: 700; BORDER-RIGHT: #ffffff; TEXT-DECORATION: none; mso-background-source: auto; mso-pattern: auto; text-underline-style: none; text-line-through: none" class=xl85></TD></TR></TBODY></TABLE>
What perplexes me the most is even with the format change in the macro, and the cells say 'number' when checking the format manually, it still sorts as text.
Thanks for any help,
Kendel, excel 2007