+ Reply to Thread
Results 1 to 9 of 9

How to auto-create and sort a worksheet?

  1. #1
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    How to auto-create and sort a worksheet?

    I enter data about my LP records collection into a spreadsheet.
    Each "box" of LPs is on a different WorkSheet: Box1 or Box2 or Box3, etc...
    How can I make another WorkSheet to have all of the contents of Box1 and Box2, etc…
    And automatically sort all of it in the sequence of one of the columns?
    I want to enter data only into the "Box" sheets,
    and have the "ByArtist" sheet automatically constantly updated.
    In the sample file, I have manually created that ByArtist worksheet.
    This is possible, yes?
    Thanks, people.
    Mark53
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to auto-create and sort a worksheet?

    Hi Mark
    see if this macro works
    it clears the used range in sheet "ByArtist" (except the first row), and copies the contents of each sheet with a name beginning with "box" into that sheet (again except the first row), then sorts on column A
    clearing the contents of your old list and creating a new one is actually quicker and easier than adding only new entries. Let me know if for some reason you'd prefer to keep the old entries in "ByArtist"

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: How to auto-create and sort a worksheet?

    Wow. That's Magnificent, Nicky.
    I've rarely used Macros, so it took a while to figure out how to
    make it execute whenever the spreadsheet is opened. Cool.
    The only problem: it copies the Formulas from the "box" sheets.
    Therefore, the column D Sequence cells are wrong on the ByArtist sheet.
    Can ya' tell us How to correct that?
    Thanks very much.

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to auto-create and sort a worksheet?

    hi
    this version should paste values


    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: How to auto-create and sort a worksheet?

    Hi Mark53,

    Alternatively, you could do it with a Pivot Table - see attached.
    (no formulas - no Macros)

    Regards

    peterrc
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: How to auto-create and sort a worksheet?

    That's a great improvement, Nicky.
    Maybe you can also solve this problem?
    If I make any change in Box1 or Box2, then save the file,
    and when I open up the same file again, it gets an error:
    Microsoft Visual Basic
    Run-time error '1004':
    The sort reference is not valid.
    Make sure that it's within the data you want to sort,
    and the first Sort By box isn't the same or blank.
    (Continue - End - Debug - Help)

    I've tried to save the attached file in that condition.
    I think you will get the same error when you open it.

    I'm thinking this may be a clue?: in the ByArtist sheet,
    the Rows / cells that were most recently Pasted to
    that ByAuthor sheet are highlighted. Is that a problem?

    Thanks very much for your help, here.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to auto-create and sort a worksheet?

    Hi
    auto open macros can fall over if the range being altered is not in the active sheet. Adding in a line of code to select the sheet with the sort range seems to do the trick:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: How to auto-create and sort a worksheet?

    Magnificent! Perfect! YOU are Brilliant, Nicky.

    Thanks Very Much.

  9. #9
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: How to auto-create and sort a worksheet?

    Waitaminute. Now, THIS is just a HYPOTHETICAL question.
    I don't really Want this capability: I'm just curious as to whether or not it is possible.
    The thought occurred to me:
    Is it possible to have that ByAuthor sheet created and updated automatically, any time that a change is made to a Box sheet?
    I know that we can assign a macro to an icon on the top row, and execute that macro whenever we want.
    But can we execute that macro, to re-create the ByAuthor sheet, after any change is made in a Box sheet?

    Or, might that result in a silly-CPU-intensive drain? Maybe, instead. . .
    Can the macro be run whenever I Click on the ByAuthor sheet tab (to open that sheet)?
    That could be cool. Is That possible?

    JUST CURIOUS. How tough would that be? Your thoughts?

    Thanks for your time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 12-16-2015, 02:42 AM
  2. [SOLVED] Macro to Copy Master Worksheet create and paste in new auto named worksheet
    By TheRealLethality in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2014, 12:46 AM
  3. [SOLVED] How to get 'auto sort' (by Alf) to work in my worksheet
    By nje in forum Excel General
    Replies: 20
    Last Post: 02-11-2013, 04:10 PM
  4. Replies: 4
    Last Post: 08-10-2012, 04:58 PM
  5. auto sort worksheet by date
    By kcrush in forum Excel General
    Replies: 3
    Last Post: 02-02-2012, 01:34 PM
  6. How to create an auto sort macro
    By knapper78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2009, 02:41 PM
  7. auto sort entire worksheet by one date column
    By kalisun in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2007, 02:12 PM

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