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!
ABCD
9Johnson16486
10White57452
11Peden85385
12Shearin44245
13Roberts99132
14Donaldson32120
15Rodriguez7184
16Catalano4642
17Butler8312

<tbody>
</tbody>
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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