+ Reply to Thread
Results 1 to 9 of 9

Last column sorting for fixed rows through VBA

  1. #1
    Registered User
    Join Date
    02-27-2012
    Location
    UK
    MS-Off Ver
    Excel 365
    Posts
    65

    Last column sorting for fixed rows through VBA

    trying to fix the code for sorting on the last column of every sheet the sorting on rows to be done at Rows 3:20 & 22:32.
    Found the below code but I am unable to incorporate my desired rows in it. unable to crack how to define the rows in the below code.

    image.jpg

    Please Login or Register  to view this content.
    Last edited by tabkaz; 10-20-2021 at 06:49 AM. Reason: sample data

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Last column sorting for fixed rows through VBA

    Will the rows that need sorting always be the same across all sheets?
    Will the last column be the same on each sheet?

    BSB

  3. #3
    Registered User
    Join Date
    02-27-2012
    Location
    UK
    MS-Off Ver
    Excel 365
    Posts
    65

    Re: Last column sorting for fixed rows through VBA

    Rows will be the same but the last column will change as per the data.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Last column sorting for fixed rows through VBA

    Without a sample workbook it's difficult to test but give this a try.
    Please Login or Register  to view this content.
    BSB

  5. #5
    Registered User
    Join Date
    02-27-2012
    Location
    UK
    MS-Off Ver
    Excel 365
    Posts
    65

    Re: Last column sorting for fixed rows through VBA

    Thanks, it works,
    it's working fine for sorting in ascending order, what to add if I have sorted in descending order for all the sheets?
    Last edited by tabkaz; 10-21-2021 at 02:11 AM.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Last column sorting for fixed rows through VBA

    Happy to help

    BSB

  7. #7
    Registered User
    Join Date
    02-27-2012
    Location
    UK
    MS-Off Ver
    Excel 365
    Posts
    65

    Re: Last column sorting for fixed rows through VBA

    it's working fine for sorting in ascending order, what to add if I have to sort in descending order for all the sheets?

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Last column sorting for fixed rows through VBA

    Try this:
    Please Login or Register  to view this content.
    BSB
    Last edited by BadlySpelledBuoy; 10-21-2021 at 02:29 AM.

  9. #9
    Registered User
    Join Date
    02-27-2012
    Location
    UK
    MS-Off Ver
    Excel 365
    Posts
    65

    Re: Last column sorting for fixed rows through VBA

    have adjusted the code for sorting in descending order,

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Add rows in Alternate columns, divide by fixed rate per column.
    By jomili in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-12-2017, 06:46 PM
  2. Replies: 0
    Last Post: 04-14-2016, 12:44 AM
  3. [SOLVED] Sorting columns with rows with a fixed "Sort" button
    By dmed99 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2015, 07:05 PM
  4. Replies: 13
    Last Post: 10-13-2015, 04:17 AM
  5. Sorting 5 Columns keeping the earlier column data fixed
    By gaurav225 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-04-2014, 07:06 AM
  6. Sorting Rows by Value in a column
    By The Monk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2013, 06:37 AM
  7. Replies: 1
    Last Post: 06-02-2010, 10:56 PM

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