Consulting

Results 1 to 3 of 3

Thread: Sort a named range

  1. #1

    Sort a named range

    Howdy,

    I am having a problem sorting a dynamic named range in VBA. I don't know if it's just a syntax error or something far more sinister. If I have a dynamic range named "Workload" in a sheet named "Analytic Workload", can somebody show me a macro to sort it?

    Thanks

  2. #2
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    Can you post an example workbook?
    Regards,

    Patrick

    I wept for myself because I had no PivotTable.

    Then I met a man who had no AutoFilter.

    Microsoft MVP for Excel, 2007 & 2008

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Sub Sorts()
    Range("Workload").Sort Key1:=Range("Workload").Cells(1), _
    Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, _
    MatchCase:=False, Orientation:=xlTopToBottom
    End Sub
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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