SORTING WORKSHEET TABS

T

Tree

I need help with the VB project listed on Pearson's webpage for sorting and
ordering tabs within a worksheeet.

I tried to follow the directions given for other posters regarding this same
subject but I am missing something becasue I cannot get the macro to work.

First when I try it (by just copying the code straight from the webpage and
inserting into VB) - I do not get a macro at all to come up to select when I
click ALT F8 to bring up the macro dialog box. Once I insert the code that
"calls it up" as suggested by Dave Petersen in a post dated 7/15/08 which is
the following:

Option Explicit
Sub testme()
If SortWorksheetsByName(0, 0, "", False) = False Then
MsgBox "something bad happened"
Else
MsgBox "ok--check the sheets"
End If
End Sub


and then I press ALT F8 to run it - I get an error message saying that the
Compile Error - Sub or Function not defined...
and TestFirstLastSort is highlighted on this line (the one that starts with
B):

'''''''''''''''''''''''''''''''''''''''
' More than one sheet selected. We
' can sort only if the selected
' sheet are adjacent.
'''''''''''''''''''''''''''''''''''''''
B = TestFirstLastSort(FirstToSort, LastToSort, ErrorText)

so, obviously I am missing something.. I never have had this much trouble
copying and pasting any of the code so generously shared here on these forums
so I am sure it is definitely user error..

I appreciate any guidance that could be given!!
Thank you.
 
T

Tree

PLEASE.. Never mind! I figured it out.. I had neglected a very important
piece of Mr. Pearson's code that is provided at the bottom of the webpage..
once I had that, it worked like a charm!!!

THANK YOU!!!!!!!!!!!!!
 

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