+ Reply to Thread
Results 1 to 2 of 2

Can't figure out how to set proper range based on last row/column of data in sort macro

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    70

    Can't figure out how to set proper range based on last row/column of data in sort macro

    Hi,

    I am using a macro that is derived from an article I found online. It is working right now, but because I don't know how to modify the macro well enough, I defaulted to making the range in the code to be a range which I know we will never extend beyond in our speadsheet.

    Basically this just sorts every single column individually in ascending order. It takes a VERY long time to run because it keeps trying to do this for all columns through to AZZ. It would be better if it knew where the last column and row with data was and then only performed the action for that range.

    Is that possible?

    Here is my current code:
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Can't figure out how to set proper range based on last row/column of data in sort macr

    look here how to determine last occupied column and row: http://www.rondebruin.nl/win/s9/win005.htm
    Best Regards,

    Kaper

+ 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. Replies: 0
    Last Post: 03-01-2015, 01:56 PM
  2. Replies: 1
    Last Post: 09-14-2014, 02:10 PM
  3. [SOLVED] Identifying data in one column based on highest figure data in another column
    By Doofus1 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-21-2014, 02:31 PM
  4. [SOLVED] I have a sort macro. How to add script to preselect rows to sort based on column value?
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-09-2014, 02:25 AM
  5. Replies: 2
    Last Post: 01-15-2014, 09:31 AM

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