+ Reply to Thread
Results 1 to 13 of 13

Get Sheet Names - Remove Sort from this code

  1. #1
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Get Sheet Names - Remove Sort from this code

    This code works well to get sheet names form a closed workbook. But can someone tell me how to remove the sorting Alphabetical form this code? Its a little too complex for me I dont know how to remove the sort.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    Hi, I would get rid of the entire ActiveX etc and just do it this way

    Please Login or Register  to view this content.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    I have been trying to get this to work and having issues. it clears the existing A Column but doesn't add back the sheet names to the file I open. Before it didn't actually open the file i am pulling the sheet names from (which is how I wanted it), and now its trying to open it (because its activating a macro within the file I am selecting). I have to change the column to B not sure of that screwed it up?

    This is the original code with B being the destination

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    The code you have just attached works fine here so I don't get the issue.
    Yes, the only thing is the sorting which remains.
    The code I posted without the ActiveX works fine too except that I added the enable events False to avoid macro's from being executed
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    It doenst work with the XLSB file I'm trying to do it with. But my original issue is the sorting, I didnt want it to sort A-Z. Did your code fix this?

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    The code I posted works with any Excel file that will permit macros.
    If you say it doesn't work, WHAT doesn't work? Be a little more specific

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    Here are two files with the same code, one xlsm and one xlsb
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    That was absolutely genius!! Thank you so much!

  9. #9
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    How can I get the sheet name list to start in row 3 instead of row 2?

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    I don't want to come across as be-learning but when you already have vba code and use it, I would at least expect some basic idea of how VBA works.
    I would suggest you play along with the code and test, trial and error, that's the way it works and a lot of patience and time.
    For now this is what you have to do

    Modify this section of the code (my version) insert the row marked in red

    Please Login or Register  to view this content.
    Place any text you want instead of Hello but it's to give you the idea.
    Since the entire column is cleared of contents you have to re-insert a value to be used as header, so you can do that on any row

  11. #11
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    I took an online course a few years ago. If you know any good ones let me know (seriously no sarcasm). I really appreciate your help!

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Get Sheet Names - Remove Sort from this code

    I never got the change for taking any courses in VBA, just practice and lots of time.
    I was lucky that my job permitted this and I just went for it.
    Some links, not all really tried out but some things I did pick up there
    https://excelvbaisfun.com/#Intro
    And the next one is really great
    http://www.cpearson.com/Excel/Topic.aspx

    You can also check out Ron de Bruin, good one too
    Happy coding

  13. #13
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Get Sheet Names - Remove Sort from this code

    Thank you!

+ 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. [SOLVED] Trying to remove duplicate names from a look up code to count
    By MR22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-22-2018, 04:46 PM
  2. [SOLVED] How do i remove names from sheet if it appears on another sheet
    By dougers1 in forum Excel General
    Replies: 3
    Last Post: 05-15-2016, 12:57 PM
  3. Replies: 28
    Last Post: 06-07-2015, 04:20 PM
  4. [SOLVED] VB Code to sort Names Alphabettically
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-05-2015, 11:41 AM
  5. Replies: 1
    Last Post: 10-06-2014, 09:44 AM
  6. VBA code to Copy, remove duplicate and sort
    By GEMINI528 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2013, 04:12 PM
  7. [SOLVED] Remove names from comments with vba code
    By Harribone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2013, 03:59 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