Auto Sort Range of Cells

caj1980

Board Regular
Joined
Oct 23, 2013
Messages
108
I have seen several posts that answer my question but I am not smart enough to tweak the code to fit my cell range. Could someone please help me write the script to put in my VBA code to auto-sort Range A9:D17 any time a value in Column D changes. Note that Column D cells are actually formulas that reference other cells in the workbook (=Sheet2!D7). Thanks![TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD] [/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D [/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Johnson[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]486[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]White[/TD]
[TD]5[/TD]
[TD]7[/TD]
[TD]452[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Peden[/TD]
[TD]8[/TD]
[TD]5[/TD]
[TD]385[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]Shearin[/TD]
[TD]4[/TD]
[TD]4[/TD]
[TD]245[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]Roberts[/TD]
[TD]9[/TD]
[TD]9[/TD]
[TD]132[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]Donaldson[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]120[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]Rodriguez[/TD]
[TD]7[/TD]
[TD]1[/TD]
[TD]84[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]Catalano[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]42[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]Butler[/TD]
[TD]8[/TD]
[TD]3[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
clarification: sort range A9:D17 based on values in Column D, triggered by any change to Column D
 
Upvote 0
Was it this one?
Rich (BB code):
' Put this code into the sheet's module
Private Sub Worksheet_Calculate()
  Range("A9:D17").Sort Range("D17"), xlAscending, Header:=xlNo
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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