WORKSHEET SORTING NOT WORKING?

F

FARAZ QURESHI

From the archives I was directed to:

http://www.cpearson.com/excel/sortws.aspx

I entered the entire 4 pieces of code:
1. SortWorksheetsByName;
2. SortWorksheetsByNameArray;
3. GroupSheetsByColor; and
4. Supportive code;

in a single module by:

1. Alt+F11;
2. Insert>Module;
3. Copying & pasting all the 4 parts;

Now I entered in one worksheet:
=SortWorksheetsByName(0,0,"NO")

The formula/function returns TRUE however how 2 make it work and do the
sorting of the worksheets???
 
D

Dave Peterson

This function was not meant to be called from a cell on a worksheet.

It was meant to be called from a different subroutine.
 
F

FARAZ QURESHI

Sorry I couldn't understand how and from where to be called.

Would you kindly elaborate the same as a display?
 
D

Dave Peterson

The function is to be called from a subroutine or another function in your
code--not put in a formula in a cell.
 
F

FARAZ QURESHI

Sorry still unclear despite of all my exercise during the whole night,

Kindly suppose,

I want to create 3 macros with shortcut key for all such three sorting
methods and add it in my MasterAddin.xla

What & How to do so?
 
D

Dave Peterson

Don't put the function in a formula in a worksheet.

Create a subroutine that calls the function, then use tools|macro|macros to run
that subroutine.

FARAZ said:
Sorry still unclear despite of all my exercise during the whole night,

Kindly suppose,

I want to create 3 macros with shortcut key for all such three sorting
methods and add it in my MasterAddin.xla

What & How to do so?
 

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