+ Reply to Thread
Results 1 to 5 of 5

Make a macro bigger than 64k

  1. #1
    Registered User
    Join Date
    07-13-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Make a macro bigger than 64k

    I need a macro to go through over 5000 files and seperate thoese files into 20-25 differend spreadsheets. I can do this upto a point but once i hit over 64k it wont work. Knowing that this has been a standard since the early office/windows 95 days. Is there a registry hack or anything with faster computers these days to make it read them?
    any help would be great. Included is one I wrote for a smaller batch that seperates usually about 1200 files into 4 different spreadsheets.
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Make a macro bigger than 64k

    Do you mean increase the number of Rows? If you do then you need to get Excel 2007
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-13-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Make a macro bigger than 64k

    i'm using 2007 but when i hit a macro thats size as a saved txt doc is larger than 64k it breaks

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Thumbs down Re: Make a macro bigger than 64k

    Thats just plain scary.... what on earth are you doing with a single SUB that is over 64k? I'd look at breaking it down and seperating it across several modules if I was you!

    It would seem there is a LOT of redundant code in there, many many many 'Select' statements and I am sure some of the code could be made to use loops with offsets, and thats just with a quick glance.

    The way I see it you have 2 choices;

    A) Go through your code, improve the code condensing it as you do so
    B) Stay with the bloated code you have, but you will still need to divide it into seperate modules, and seperate functions, which I think will be difficult if you don't do 'A' first anyway.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Make a macro bigger than 64k

    You have MULTIPLE instances of "If DestTWO > Zero" and looking at what you do when it's true, it looks like you're doing the same thing over and over, just in different columns.

    There's no reason you can't collect ALL of the various "If DestTWO > Zero" sections and put them all into a single grouping, or at least WAY reduce the number of them. For Example:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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