Results 1 to 3 of 3

Thread: How to sort single column (selected)?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    VBAX Regular
    Joined
    Dec 2021
    Posts
    58
    Location
    I fixed the problem, there was typo in xlN => xlNo and missing key1... seems not to be optional argument.
    ActiveSheet.Range("A1").Select
    ' Sort and Autofit the 2nd column in Nemocnice
    Set DataColumn = Selection.CurrentRegion.Offset(1, 1).Columns(1)
    DataColumn.AutoFit
    DataColumn.Select
    Range(DataColumn.Address).Sort Order1:=xlAscending, Key1:=Range(DataColumn.Offset(-1).Address), Header:=xlNo
    Selection.CurrentRegion.Offset(, 1).Columns(1).AutoFit
    Last edited by vangog; 12-27-2021 at 12:02 PM. Reason: fixed

Posting Permissions

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