+ Reply to Thread
Results 1 to 2 of 2

Need macro that can sort a particular column across many differently named documents.

  1. #1
    Registered User
    Join Date
    02-07-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Need macro that can sort a particular column across many differently named documents.

    Hello everyone! New to the forum here, but been lurking for about a week. I've already picked up lots of helpful information here, thanks to everyone who contributes!

    GOAL:
    I'm trying to create a macro that will sort a particular column alphabetically across many different excel documents. All of the documents have the exact same amount of columns, but vary in row length, and have different names. I used the record macro function to do this, as I'm still very much a newbie in using Visual Basic:

    Please Login or Register  to view this content.
    ISSUE:
    The problem is that this will only work with a worksheet with the name of "xlWorksheet" otherwise I receive an error reading: "Run time error '9': Subscript out of range"

    I need this macro to work across numerous documents with different names, all of which are formatted the same.

    It is part of a larger macro which also formats, highlights, and adds data, all of which is working.

    CONCLUSION:
    I'm sure there is a very simple fix to the code that will allow me to access whatever the current worksheet is, instead of just the one that is named in the code.

    So far I've tried changing it to ThisWorkbook instead of ActiveWorkbook, but no luck.

    All help will be very much appreciated!

    Cheers!
    Last edited by slylikeme; 02-07-2013 at 03:22 PM.

  2. #2
    Registered User
    Join Date
    02-07-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need macro that can sort a particular column across many differently named documents.

    Ok, after some more digging I've solved the issue.

    In case anyone cares, here is what I did.
    Please Login or Register  to view this content.

+ 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