+ Reply to Thread
Results 1 to 3 of 3

Sort the same column of data in same wb across 31 ws

  1. #1
    Registered User
    Join Date
    03-25-2011
    Location
    New York, NY
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    Red face Sort the same column of data in same wb across 31 ws

    Hi all, apologies for not being able to figure this out from other posts. I have a workbook of 31 worksheets. All worksheets contain the same number of columns and rows and are in the same positions on each sheet (i.e. column c in each ws is dollar sales, column d is unit sales, etc.) The only differences are the data values because each worksheet is for a different retailer.

    Rather than going into each sheet, one at a time, and sorting the entire data table by the descending values in one of the columns (dollar sales, column L), is there a code that will start on the worksheet I am in (the first in the workbook, called US Food) and loop through all worksheet to sort each worksheet by column L, descending values?

    I have tried a couple of scripts I found but when I run any of them I get error messages (the latest is runtime error 1004: This operation requires the merged cells to be identically sized.) I unmerged any merged data on all sheets, but am still getting this runtime error.

    Thanks very much for any assistance you can provide!

    Best regards,

    Darlene
    Last edited by dlyliny7203; 10-26-2011 at 09:37 AM. Reason: Add file

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Noob VBA Code question

    Hi Darlene,

    If you upload a sample workbook (one or two worksheets with similar structure to the one you use) then we can give specific guidance. Usually the best option is to use the macro recorder in Excel and then add a loop. If you can do the first part by recording all the steps that you would normally do for just one sheet, then we should be able to help clean the code up and add a loop to do the same for all the worksheets in the workbook.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    03-25-2011
    Location
    New York, NY
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    Re: Noob VBA Code question

    Will do, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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