Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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!!!!!!!!!!!!! "Tree" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting Worksheet Tabs | Excel Discussion (Misc queries) | |||
Sorting Worksheet Tabs | Excel Worksheet Functions | |||
Sorting Worksheet Tabs | Excel Discussion (Misc queries) | |||
Sorting a range of worksheet tabs A-Z | Excel Worksheet Functions | |||
sorting tabs | Excel Discussion (Misc queries) |