+ Reply to Thread
Results 1 to 3 of 3

Sort macro not working on hidden rows?!

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Sort macro not working on hidden rows?!

    Hello Everyone,

    I have a macro that I want to run when it is activated but cannot get it to work the way I want it to!
    On my sheet different rows between 11 and 35 are hidden. Some of the hidden rows contain data
    that I want to reveal when the "PaperWork" Macro is run. The problem is that the macro only sorts
    the unhidden cells leaving the hidden cells unsorted! I do not know why but any help is appreciated.
    The macro is very basic and below:

    Sub PaperWork()
    Range("B11:Y35").Select
    Selection.Sort Key1:=Range("B11"), Order1:=xlAscending, Header:=xlGuess _
    , OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    End Sub

    I have been trying to get this work for about 3 hours now!!!
    Thank you very much for any help.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Sort macro not working on hidden rows?!

    unhide hidden rows, then sort and hide again
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Sort macro not working on hidden rows?!

    Hello patel45,
    I thought about that but the problem is that if i do that there is a different amount of rows being hidden every time! If I unhide / sort / rehide I do not know how many rows to hide as it will be different every time! I cannot take step back twice as the step back will reverse the sort, taking the sheet back to where it was in the first place!
    Thank you for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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