Results 1 to 5 of 5

Sorting full table by name

Threaded View

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    hamburg, germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Sorting full table by name

    hi,
    i´m new to excel. i´ve created a table B16 to H25
    B=name C=adr D=city E=zip ... etc.
    when i insert a new name, i want to to automaticaly sort
    the table by the names.
    the following code only sorts B, the columns from C to H
    are untouched. what is wrong ?

    Private Sub worksheet_Change(ByVal Target As Range)
    On Error GoTo fehler
    Application.EnableEvents = False
        Range("B16:H25").Select
        ActiveWorkbook.Worksheets("Endstand").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Endstand").Sort.SortFields.Add Key:=Range("B16:B25"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Endstand").Sort
            .SetRange Range("B15:H25")
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    fehler:
    Application.EnableEvents = True
    End Sub
    thx and regards from germany
    thorsten
    Last edited by thorb; 04-19-2012 at 01:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1