+ Reply to Thread
Results 1 to 7 of 7

Finding last item in column for sorting

  1. #1
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Finding last item in column for sorting

    Hi

    I'd like to find the last item in a column and then perform a sort on the data. This code finds the last item ok, but then fails on entering the location in the sort command. A problem with my use of variables maybe. Please could you advise where I am going wrong...

    Please Login or Register  to view this content.
    Last edited by vonsworld; 07-05-2020 at 04:20 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Finding last item in column for sorting

    Thanks for the code tags.
    Last edited by jindon; 07-05-2020 at 04:22 AM.

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

    Re: Finding last item in column for sorting

    Before we can help you need to follow forum rule #2 and wrap your VBA in code tags.
    Edit your original post, highlight all the code then click the # icon before saving the amendment.

    BSB

  4. #4
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Re: Finding last item in column for sorting

    Thanks, problem noted for future use and post updated :-)

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Finding last item in column for sorting

    Try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Re: Finding last item in column for sorting

    All Working, Thanks :-)

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

    Re: Finding last item in column for sorting

    Worth pointing out that rather than looping through cells one by one to find the last row and then sorting, you could perform the same action with a single line of code.

    Please Login or Register  to view this content.
    BSB

+ 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. Finding an item that isn't matching.
    By kylpr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2017, 04:42 PM
  2. Replies: 2
    Last Post: 12-14-2016, 12:20 AM
  3. Formula help please - finding a last item/status
    By Looloo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2014, 03:31 PM
  4. Finding out which item has the most and the least cost
    By quantum231 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2013, 11:29 AM
  5. Finding the first item in a subset
    By NumeroUno in forum Excel General
    Replies: 10
    Last Post: 06-17-2013, 09:08 AM
  6. Replies: 5
    Last Post: 05-17-2012, 10:51 PM
  7. Promblem with finding an item in a list
    By lorcanjc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2005, 06:20 AM

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