+ Reply to Thread
Results 1 to 6 of 6

Resolved >>> Adjust code to include sorting employee sheets a-z?

  1. #1
    Registered User
    Join Date
    10-08-2007
    Posts
    33

    Resolved >>> Adjust code to include sorting employee sheets a-z?

    Hi to Ikaabod and anyone else that may be able to help.

    Since asking for help I have written my first bit of VBA code all by myself! (although admittedly used some help files to adapt to my requirements someone elses code).

    As you may remember, Ikaabod wrote some code to help me create new absence sheets using a user form.

    I was wondering how I would add in code to sort the worksheets from A-Z.

    Also, Ideally, I would like to hide the template sheet that the new records are copied from. Is it possible to add code that would unhide the resulting worksheet once it is copied and renamed?

    I am learning loads from this forum, so thank you once again.

    Here is the code in it's current state:

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    10-08-2007
    Posts
    33
    bump for evening

  3. #3
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    For worksheet sorting, take a look at Chip Pearson's explanation and code: HERE

    The following code will hide and then unhide a worksheet named "Template"
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-08-2007
    Posts
    33

    Hiding issue sorted, but about that Chip Pearson code...

    Thanks Ikaabod, I have got the copied sheet to become visible now.

    I have read the help sheet you pointed to, & it looks exactly what I am looking for, but I don't understand where I would put it in my existing code to make it part of the process in making a new absence sheet.

    In other words, I was hoping that after copying & renaming the sheet to match the userform inputs, it would then sort the sheets.

    I have looked at it several times, but can't figure it.

  5. #5
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    You can put the code from the link in a new Module and then put something like this:
    Please Login or Register  to view this content.
    after your code:
    Please Login or Register  to view this content.
    The "2" will likely need to be changed as your needs require, but that will sort sheets starting from your second sheet all the way to the sheet furthest to the right.

  6. #6
    Registered User
    Join Date
    10-08-2007
    Posts
    33

    Worksheets sorting beautifully!

    Thank you once again!

    The code does exactly what I wanted it to. This forum has really inspired me to get to grips with VBA.

    I intend to get a good book and digest! I think once I get a handle on the basics, i.e what a module actually is, etc, everthing will become clear.

+ 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