+ Reply to Thread
Results 1 to 7 of 7

A macro to sort a dynamic list

  1. #1
    Registered User
    Join Date
    08-07-2008
    Location
    London
    Posts
    29

    A macro to sort a dynamic list

    Morning all

    I was wondering if someone would be kind enough to provide me with a solution to my problem.

    Also posted here:

    http://www.mrexcel.com/forum/showthr...t+dynamic+list

    I have a workbook which contains several worksheets (please see attached file as an example).

    There is an ENTRY worksheet, which contains a list, which the user uses to enter details of a new product. The user adds the product to the end of the list already there. One field which must be filled is the "Status" field, where the user selects whether the product is either on sale, or sold-out.

    The other worksheets (ON SALE and SOLD-OUT) display the list of the relevant materials from the ENTRY sheet, i.e. a list of all materials sold-out, or all materials on sale, but these worksheets must be sorted in alphabetic order.

    Basically, the ENTRY sheet contains all materials unordered, and the other sheets contain only relevant materials ordered.

    The sort must be by material ID. It must be immediate (i.e. no need to "refresh" the workbook), on click of ON SALE or SOLD-OUT.

    Can someone please help me with a macro for this?

    Thanks in advance.

    Alis
    Attached Files Attached Files
    Last edited by alis88; 11-24-2008 at 10:27 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    If you're just asking for those two sheets to be sorted, the code below may help. It needs to go into the ThisWorkbook module (right-click on the Excel icon to the left of the File menu and select View Code):
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-07-2008
    Location
    London
    Posts
    29
    Hello Stephen

    Thank you for your reply. I pasted the code as you said, but nothing appeared to happen.

    Can you help further please?

    Alis

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Not sure, see attachment. Click on one of the last two sheets and the data should be sorted.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-07-2008
    Location
    London
    Posts
    29
    I need it to pick up the data in the ENTRY sheet, so what would happen is that in the SOLD-OUT sheet, it would have:

    Material ID: ALIS004, ALIS005, plus the name of the product.

    In the ON SALE sheet, it would have:

    Material ID: ALIS001, ALIS002, ALIS003, plus the name of the product.

    i.e. it would be filtered and sorted into appropriate worksheets.

    Is that any clearer to you?

    Many thanks for your help.

    Alis

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    OK, try this. It's activate automatically by the sheet, but might be better as a button.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    alis88,

    Please read forum rules below and then add the link to the other excel forum where you have also posted this question

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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