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
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.
Will do, thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks