Results 1 to 9 of 9

Last column sorting for fixed rows through VBA

Threaded View

  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

    Sub jusho()    
        Dim lColumn As Long
        lColumn = Cells(1, Columns.Count).End(xlToLeft).Column
        LastRow = Range("A" & Rows.Count).End(xlUp).Row
        
        Range(Cells(2, 1), Cells(LastRow, lColumn)).Sort key1:=Range(Cells(2, lColumn), Cells(LastRow, lColumn)), _
           order1:=xlAscending, Header:=xlNo
    End Sub
    Last edited by tabkaz; 10-20-2021 at 06:49 AM. Reason: sample data

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