Sorting Worksheets in a workbook

D

Doehead

Hi all, I am trying to use Cpearson's VBA procedure 'Sorting by Name' but I
am not sure -- do I have to copy and save it into every worksheet? My
workbook has 43 tabs so far. Thanks
 
D

Doehead

Hi Dave, I did as was instructed by the website but I got a 'Compile Error'
any idea why?
 
J

Jacob Skaria

Remove the blank line between the below two lines...and Dave's code should
work fine. A space followed by _ is a line separator

lReply = MsgBox("To sort .............

& "To sort Worksheets ...........

'remove the blank line (as below) so that VBE considers this as one line

lReply = MsgBox("To sort .............
& "To sort Worksheets ...........
 
C

Chip Pearson

Download the bas module zip file from
http://www.cpearson.com/Zips/modSortingWorksheets.zip, save it to some
folder (it doesn't matter where), and unzip the file. In VBA, go to
the File menu, choose Import and import the unzipped module.

Run the Sub named SortTheSheets to sort all the worksheets in the
workbook using the default values for the parameters to the main sort
procedure.

You need only one copy of the code, but the code must reside in a code
module, not one of the Sheet modules and not the ThisWorkbook code
module.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top