+ Reply to Thread
Results 1 to 3 of 3

How to create macro to sort data in dynamic range

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    Chester, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    How to create macro to sort data in dynamic range

    Hi,
    I'm really struggling with this one so will appreciate any help.

    I keep records of people in a file and sometimes I remove or add new people. Each row is equal to one record however there might be some data on the left so I can't select all row. The row below last record is empty and after that there are 3 rows with some formulas to summarise data in the records above. The first cell with the record is A5 and the records are as wide as to cell BJ. Although there is some data beneath, the last 5 columns on the right have no data below them so I assume that I could somehow make the macro to find the last cell with the record in column BJ and make selection to A5. When I have the range selected I need to sort the records by column C, which at the moment has only numbers in it. I forgot to mention that the last 3 columns also have formulas to summarise each record and they can store numeric value equal to or bigger than 0.

    Can somebody help me with this problem. I think I know how to do it but I just don't know VB.
    Thanks

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to create macro to sort data in dynamic range

    Luke82,

    Something like this should work for you:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-04-2012
    Location
    Chester, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to create macro to sort data in dynamic range

    Worked perfectly

    Thanks a lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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