Before
<b>Sheet1 (3)</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:74px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">A</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">B</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >1</td><td >Name</td><td >E</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >2</td><td >Address</td><td >G</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >3</td><td >City</td><td >B</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >4</td><td >State</td><td >D</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >5</td><td >Zip</td><td >A</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >6</td><td >First Name</td><td >Z</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >7</td><td >Last Name</td><td >E</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >8</td><td >Country</td><td >V</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >9</td><td >Continent</td><td >C</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >10</td><td >Division</td><td >N</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >11</td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >12</td><td >Name</td><td >E</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >13</td><td >Address</td><td >I</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >14</td><td >City</td><td >H</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >15</td><td >State</td><td >F</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >16</td><td >Zip</td><td >K</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >17</td><td >First Name</td><td >M</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >18</td><td >Last Name</td><td >K</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >19</td><td >Country</td><td >L</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >20</td><td >Continent</td><td >C</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >21</td><td >Division</td><td >N</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >22</td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >23</td><td >Name</td><td >N</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >24</td><td >Address</td><td >T</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >25</td><td >City</td><td >K</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >26</td><td >State</td><td >E</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >27</td><td >Zip</td><td >C</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >28</td><td >First Name</td><td >Z</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >29</td><td >Last Name</td><td >A</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >30</td><td >Country</td><td >X</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >31</td><td >Continent</td><td >G</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >32</td><td >Division</td><td >O</td></tr></table> <br />
Excel tables to the web - Excel Jeanie Html 4
After
<b>Sheet1 (3)</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">A</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">B</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">C</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">D</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">E</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">F</td><td style=" border-width:3px; border-style
utset;border-color:#f0f0f0; ">G</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >1</td><td >Name</td><td >Address</td><td >City</td><td >State</td><td >Zip</td><td >First Name</td><td >Last Name</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >2</td><td >E</td><td >G</td><td >B</td><td >D</td><td >A</td><td >Z</td><td >E</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >3</td><td >E</td><td >I</td><td >H</td><td >F</td><td >K</td><td >M</td><td >K</td></tr><tr style="height:18px ;" ><td style="border-width:3; border-style
utset;border-color:#f0f0f0; background-color:#cacaca; text-align:center; " >4</td><td >N</td><td >T</td><td >K</td><td >E</td><td >C</td><td >Z</td><td >A</td></tr></table> <br />
Excel tables to the web - Excel Jeanie Html 4
Revised code
Rich (BB code):
Sub SortData()
Dim LR As Long, i As Long, j As Long, k As Long
Application.ScreenUpdating = False
Range("C1:I1").Value = Array("Name", "Address", "City", "State", "Zip", "First Name", "Last Name")
LR = Range("A" & Rows.Count).End(xlUp).Row
j = 2
For i = 1 To LR
With Range("A" & i)
If .Value = "" Then
j = j + 1
Else
Select Case .Value
Case "Name": k = 3
Case "Address": k = 4
Case "City": k = 5
Case "State": k = 6
Case "Zip": k = 7
Case "First Name": k = 8
Case "Last Name": k = 9
Case Else: k = 0
End Select
If k <> 0 Then Cells(j, k).Value = .Offset(, 1).Value
End If
End With
Next i
Columns("A:B").Delete
Application.ScreenUpdating = True
End Sub