Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this modification.
Either set your ENTER key to move right upon entry or use the Tab key to move right out of column A to B Enter last name in col A and first name in col B. When you hit ENTER out of col B, A and B will sort by Last Name Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("B1:B100")) Is Nothing Then With Target If .Value < "" Then Call Macro2 End If End With End If ws_exit: Application.EnableEvents = True End Sub Sub Macro2() Range("A:B").Sort Key1:=Range("A1"), _ Order1:=xlAscending, Header:= _ xlGuess, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub Gord On Thu, 22 Jun 2006 10:20:50 -0500, OSSIE wrote: Hi and thnak you for your help one more question on this last name and name have to be in the same colum correct co is it possible to have the last name on column A and the name on B ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can i re-sort multiple worksheets into alphabetical order | Excel Discussion (Misc queries) | |||
How do I place items in alphabetical order in a column and keep da | Excel Worksheet Functions | |||
why are my files out of alphabetical order? | Excel Discussion (Misc queries) | |||
Getting Pivot Tables to automatically sort rows in alphabetical order | Excel Discussion (Misc queries) | |||
Using a macro to sort your data in alphabetical order? | Excel Discussion (Misc queries) |