Auto Sorting

Bonaocity729

New Member
Joined
Feb 23, 2018
Messages
5
Hi Everyone,

I'm new at this. Can someone help me in creating a code to Auto Sort the Data based on the Column F as soon as I type new info. Thanks in advance for any help, Jose.


<tbody>
[TD="class: xl107"] Weigh Station Operators
[/TD]
[TD="class: xl84, width: 153"] Shift [/TD]
[TD="class: xl84, width: 139"] Days Worked
[/TD]
[TD="class: xl84, width: 170"] Pieces Processed [/TD]
[TD="class: xl85, width: 128"] Total Hrs Worked [/TD]
[TD="class: xl84, width: 123"] Pieces Per Hour [/TD]

[TD="class: xl97"] DA [/TD]
[TD="class: xl98"] Day [/TD]
[TD="class: xl97, align: right"] 2 [/TD]
[TD="class: xl99, align: right"] 3,068 [/TD]
[TD="class: xl100, align: right"] 5.40 [/TD]
[TD="class: xl88, align: right"] 568 [/TD]

[TD="class: xl97"] TA [/TD]
[TD="class: xl98"] Day [/TD]
[TD="class: xl97, align: right"] 5 [/TD]
[TD="class: xl99, align: right"] 4,262 [/TD]
[TD="class: xl100, align: right"] 10.45 [/TD]
[TD="class: xl88, align: right"] 408 [/TD]

[TD="class: xl97"] CR [/TD]
[TD="class: xl98"] Night [/TD]
[TD="class: xl97, align: right"] 10 [/TD]
[TD="class: xl99, align: right"] 23,011 [/TD]
[TD="class: xl100, align: right"] 68.50 [/TD]
[TD="class: xl88, align: right"] 336 [/TD]

[TD="class: xl97"] EB [/TD]
[TD="class: xl98"] Evening [/TD]
[TD="class: xl97, align: right"] 9 [/TD]
[TD="class: xl99, align: right"] 17,002 [/TD]
[TD="class: xl100, align: right"] 53.45 [/TD]
[TD="class: xl88, align: right"] 318 [/TD]

[TD="class: xl97"] MJ [/TD]
[TD="class: xl98"] Night [/TD]
[TD="class: xl97, align: right"] 11 [/TD]
[TD="class: xl99, align: right"] 17,859 [/TD]
[TD="class: xl100, align: right"] 57.25 [/TD]
[TD="class: xl88, align: right"] 312 [/TD]

[TD="class: xl97"] DR [/TD]
[TD="class: xl98"] Night [/TD]
[TD="class: xl97, align: right"] 7 [/TD]
[TD="class: xl99, align: right"] 13,091 [/TD]
[TD="class: xl100, align: right"] 43.50 [/TD]
[TD="class: xl88, align: right"] 301 [/TD]

[TD="class: xl97"] IG [/TD]
[TD="class: xl98"] Evening [/TD]
[TD="class: xl97, align: right"] 9 [/TD]
[TD="class: xl99, align: right"] 15,699 [/TD]
[TD="class: xl100, align: right"] 53.45 [/TD]
[TD="class: xl88, align: right"] 294 [/TD]

[TD="class: xl97"] BS [/TD]
[TD="class: xl98"] Day [/TD]
[TD="class: xl97, align: right"] 12 [/TD]
[TD="class: xl99, align: right"] 14,730 [/TD]
[TD="class: xl100, align: right"] 59.60 [/TD]
[TD="class: xl88, align: right"] 247 [/TD]

[TD="class: xl97"] IS [/TD]
[TD="class: xl98"] Day [/TD]
[TD="class: xl97, align: right"] 11 [/TD]
[TD="class: xl99, align: right"] 14,672 [/TD]
[TD="class: xl100, align: right"] 59.85 [/TD]
[TD="class: xl88, align: right"] 245 [/TD]

[TD="class: xl97"] SG [/TD]
[TD="class: xl98"] Day [/TD]
[TD="class: xl97, align: right"] 10 [/TD]
[TD="class: xl99, align: right"] 11,614 [/TD]
[TD="class: xl100, align: right"] 47.45 [/TD]
[TD="class: xl88, align: right"] 245 [/TD]

[TD="class: xl97"] IZ [/TD]
[TD="class: xl98"] Night [/TD]
[TD="class: xl97, align: right"] 10 [/TD]
[TD="class: xl99, align: right"] 15,810 [/TD]
[TD="class: xl100, align: right"] 69.00 [/TD]
[TD="class: xl88, align: right"] 229 [/TD]

[TD="class: xl87"] TH [/TD]
[TD="class: xl96"] Day [/TD]
[TD="class: xl87, align: right"] 12 [/TD]
[TD="class: xl88, align: right"] 14,720 [/TD]
[TD="class: xl89, align: right"] 68.10 [/TD]
[TD="class: xl101, align: right"] 216 [/TD]

[TD="class: xl87"] BM [/TD]
[TD="class: xl96"] Night [/TD]
[TD="class: xl87, align: right"] 9 [/TD]
[TD="class: xl88, align: right"] 9,825 [/TD]
[TD="class: xl89, align: right"] 45.55 [/TD]
[TD="class: xl88, align: right"] 216 [/TD]

[TD="class: xl102"] AF [/TD]
[TD="class: xl103"] Night [/TD]
[TD="class: xl102, align: right"] 7 [/TD]
[TD="class: xl101, align: right"] 10,404 [/TD]
[TD="class: xl104, align: right"] 49.00 [/TD]
[TD="class: xl101, align: right"] 212 [/TD]

[TD="class: xl102"] TE [/TD]
[TD="class: xl103"] Day [/TD]
[TD="class: xl102, align: right"] 11 [/TD]
[TD="class: xl101, align: right"] 11,425 [/TD]
[TD="class: xl104, align: right"] 54.85 [/TD]
[TD="class: xl101, align: right"] 208 [/TD]

[TD="class: xl105"] JS [/TD]
[TD="class: xl106"] Day [/TD]
[TD="class: xl102, align: right"] 10 [/TD]
[TD="class: xl101, align: right"] 9,408 [/TD]
[TD="class: xl104, align: right"] 45.65 [/TD]
[TD="class: xl101, align: right"] 206 [/TD]

[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl88"][/TD]
[TD="class: xl89"][/TD]
[TD="class: xl88"][/TD]

[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl88"][/TD]
[TD="class: xl89"][/TD]
[TD="class: xl88"][/TD]

[TD="class: xl87"]
[/TD]
[TD="class: xl87"]
[/TD]
[TD="class: xl87"]
[/TD]
[TD="class: xl88"][/TD]
[TD="class: xl89"][/TD]
[TD="class: xl88"][/TD]

[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl87"][/TD]
[TD="class: xl88"][/TD]
[TD="class: xl89"][/TD]
[TD="class: xl88"][/TD]

[TD="class: xl90"] Total [/TD]
[TD="class: xl90"][/TD]
[TD="class: xl91, align: right"] 145 [/TD]
[TD="class: xl92, align: right"] 206,600 [/TD]
[TD="class: xl93, align: right"] 791.05 [/TD]
[TD="class: xl94, align: right"] 261 [/TD]

</tbody>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
.
Paste this into the Sheet Level module :

Code:
Option Explicit




Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next


    If Not Intersect(Target, Range("F:F")) Is Nothing Then
        Range("F2").Sort Key1:=Range("F2"), _
        Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, _
        Orientation:=xlTopToBottom
        Application.DisplayAlerts = True
    End If
End Sub
 
Upvote 0
Logit,

Thanks for creating the Code. It's exactly what I needed but I forgot to mention that I need the last Row (Row 21) which is the total intact.

Thanks once again for your help.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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