+ Reply to Thread
Results 1 to 6 of 6

Sorting of Range in VB

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Sorting of Range in VB

    Hi I've created a workbook that users can key in a record. The final tab in the workbook actually allows supervisor to have a quick overview of those records that require attention. So basically in each of the month's tab, if the completed column is yes, it will not appear in the last tab. If it's no, it will be copied into the last tab. Those that exceed a certain number of days will be highlighted to make it more prominent. Here comes the part i need assistance in. I wish to sort the data in the last tab using the following order, by the name, followed by number of days. I keep failing to get it to sort. Appreciate if anyone could offer me some assistance.

    I've attached a copy of the incomplete file for perusal.

    Thank you
    Attached Files Attached Files
    Last edited by hoongz; 07-19-2012 at 05:15 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Sorting of Range in VB

    Are you able to get the data to be copied to the outstanding tab? Or do you need code for that?

    This is the sort code you can use -
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Sorting of Range in VB

    Hi Arlu,

    Thanks for your assistance. But this isn't working out for me. They said opject doesn't support this property or method. and highlight the 2nd field codes as shown below when i debug it

    Please Login or Register  to view this content.
    Last edited by hoongz; 07-19-2012 at 04:56 AM.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Sorting of Range in VB

    Oops...change this line from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Sorting of Range in VB

    It works fine now thanks alot. But is it possible to set the sorting to start at the 5th row? Since I set my 4th rown to be the header.

    Tested by changing the range and it worked. Thanks alot
    Last edited by hoongz; 07-19-2012 at 05:12 AM.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Sorting of Range in VB

    Try this code

    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)

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