+ Reply to Thread
Results 1 to 6 of 6

Sort all Worksheets

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Sort all Worksheets

    I want to sort all worksheets (identical layout); C1:N75 with headers in row 1. Sort by Total (C1) from largest to smallest. Why isn't my code doing anything?
    In ThisWorkbook
    Please Login or Register  to view this content.
    Trying to help someone (here http://www.excelforum.com/excel-gene...5-sorting.html).
    Last edited by ChemistB; 09-30-2010 at 08:30 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sort all Worksheets

    It should be:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort all Worksheets

    The error is that the control variable of the For Each loop is an object (Romper's code), not a string (as used in your code).
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sort all Worksheets

    and the ranges weren't being qualified with the worksheet.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort all Worksheets

    Yeah, that too

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sort all Worksheets

    Thanks to both of you. Looks like I need to read some VBA books. I would never have known that through trial and error alone. Thanks Again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1