Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This seems like it should be simple, but I'm not having luck figuring out how
to do it. Any help would be appreciated. I have a simple list of 10 things each with a value associated with it. As the values change, I'd like the list to automatically resort itself in ascending order. I don't want to have to go and highlight the two columns and use the sort command every time I change one of the values. This should be easy right??? help. -- Thanks, CBguy |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Right-click on w/sheet tab (where your data is) "View code", and copy/paste
code below. If Column B .. no check for rows ...is changed, it sorts (by column B) values. HTH Sub Worksheet_Change(ByVal target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If target.Column < 2 Then Exit Sub Columns("A:B").Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal ws_exit: Application.EnableEvents = True End Sub "cbguy" wrote: This seems like it should be simple, but I'm not having luck figuring out how to do it. Any help would be appreciated. I have a simple list of 10 things each with a value associated with it. As the values change, I'd like the list to automatically resort itself in ascending order. I don't want to have to go and highlight the two columns and use the sort command every time I change one of the values. This should be easy right??? help. -- Thanks, CBguy |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hey, that works great. Thanks for the help. : )
-- Thanks, CBguy "Toppers" wrote: Right-click on w/sheet tab (where your data is) "View code", and copy/paste code below. If Column B .. no check for rows ...is changed, it sorts (by column B) values. HTH Sub Worksheet_Change(ByVal target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If target.Column < 2 Then Exit Sub Columns("A:B").Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal ws_exit: Application.EnableEvents = True End Sub "cbguy" wrote: This seems like it should be simple, but I'm not having luck figuring out how to do it. Any help would be appreciated. I have a simple list of 10 things each with a value associated with it. As the values change, I'd like the list to automatically resort itself in ascending order. I don't want to have to go and highlight the two columns and use the sort command every time I change one of the values. This should be easy right??? help. -- Thanks, CBguy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data sorting automatically? | Excel Worksheet Functions | |||
sorting a dropdown list automatically | Excel Worksheet Functions | |||
Sorting Data Automatically | Excel Worksheet Functions | |||
Sorting data automatically | Excel Worksheet Functions | |||
sorting automatically | Excel Worksheet Functions |