auto-sort for excel 2010

ISSOWAVES

New Member
Joined
Sep 9, 2011
Messages
8
Hello,

I'm making a task-list with excel 2010. I want the data I input into column B to auto-sort all column to E. So it will start with B finish with E.

As for the # of rows, it will start from row 2 and finish at row 35.

Is there a way to auto-sort this information whenever new data is inserted. We choose new data by the drop down menu in column B.

Any help will be greatly appreciated it.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try the following code which needs to be placed in the sheet module (right-click the sheet tab, and select 'View Code')...

Code:
[font=Verdana][color=darkblue]Private[/color] [color=darkblue]Sub[/color] Worksheet_Change([color=darkblue]ByVal[/color] Target [color=darkblue]As[/color] Range)
    [color=darkblue]If[/color] Intersect(Target, Range("B2:B35")) [color=darkblue]Is[/color] [color=darkblue]Nothing[/color] [color=darkblue]Then[/color] [color=darkblue]Exit[/color] [color=darkblue]Sub[/color]
    [color=darkblue]With[/color] Range("B2:E35")
        .Sort key1:=Range("B2"), Order1:=xlAscending, Header:=xlNo, OrderCustom:=1, _
            MatchCase:=False, Orientation:=xlTopToBottom
    [color=darkblue]End[/color] [color=darkblue]With[/color]
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
[/font]
 
Upvote 0
hi Domenic

Yes! it worked. Thanks very much for your help.

One other thing, I have two task list on one sheet. The code you provided works for the first task list, but I hope it can also work for the second task list.

The other task list is at located at:
column G:J
row 2:35
 
Upvote 0
i had trouble posting this, which is why i accidentally posted it twice. i couldn't figure out how to delete it.
 
Upvote 0
OK, there was a problem with the board yesterday which might explain that.

For future reference you cannot delete your posts but you can click the Report button to request the moderators to remove a duplicate thread or post.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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