+ Reply to Thread
Results 1 to 7 of 7

procedure exceeds 64K

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    Elberta, Al
    MS-Off Ver
    Excel 2007
    Posts
    91

    procedure exceeds 64K

    After getting help from you guys on how to do the macros auto sorting, I have played around with it a couple of day to make sure I understood what to do to make it work for me. So far all was good. so yesterday I spent most of the day doing my entire program.
    Only problem was when I finished it I got an error saying: Code for this procedure exceeds 64K when compiled.
    Break this, and any other large procedures, into two or more smaller procedures. then it gave me the entire code thing, I think explaining what cell I started with and what cell I finished at, and a whole bunch of stuff in between that I have no idea what they mean. but I did copy it just in case I may need it.

    My question is when using Macros record Now and you get a message like this -procedure exceeds 64K Break this and any other large procedures, into two or more smaller procedures. is there a way to insert something into the code thing it was showing me to break it into section that will allow it to run my program. can I like put part 1 and part 2 in the code thing without having to do the whole program over again. man I hope so.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: procedure exceeds 64K

    If you have used the macro recorder to create your code, it records every cell selection and screen movement, most of which you don't need.

    Bear in mind the code you get from the macro recorder will repeat exactly what you did ... warts and all!

    First thing to do is get rid of all the screen movement instructions ... like small scroll, in fact, anything to do with scrolling.

    In the meantime, post the code ... or, even better, a sample workbook, and you will get more detailed advice.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: procedure exceeds 64K

    Hey buddy,

    Basically when you record macro, Excel records every-single-tiny settings from the sheet. For example, if you'd just like to bring the text to the center both vertical and horizontal ways, Macro would be :

    Please Login or Register  to view this content.
    whereas you needed to make change in just two settings - Vertical Alignment and HorizontalAlignment. Following code can replace the above code.

    Please Login or Register  to view this content.
    Hope, you're getting me. Record Macro is an AWESOME tool which can be used as a mentor for oneself. Its helps us get an idea of how things work. After learning, one should tweak the codes and filter the unnecessary codes out of your procedure (method or macro). This is to ensure we don't overload our processor with unnecessary instructions so that we get fast and perfect solutions for us.
    cOdEsLiZeR - Back after a long break.. Let's sLiZe some more cOdEs!!

  4. #4
    Registered User
    Join Date
    05-30-2013
    Location
    Elberta, Al
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: procedure exceeds 64K

    Back to TMSHUCKS and codeslizer, please beleive me when I say I'm slow, but when I catch on I'm ok. TM ask for a sample work sheet and the code I got,

    here a sample of what I'm trying to do. The columns are in two C-D E-F G-H I-J and so on. The rows here are 7-14 as you see I have to sort some high and some low. Is this possible to do a auto sort for each set of columns

    C---- D----------E------F--------G------H--------I------J
    BEST-------------AVG-------------EARLY-----------LATE
    SPEED-----------SPEED------------SPEED---------- SPEED
    BOX--LOW-------BOX--LOW------BOX----HIGH------BOX--HIGH
    1---- 31.3-------1---- 31.47 ----- 1-----87.55------1-------0
    2---- 31.2-------2-----31.69------2---- 51.53------2-----(-1
    3---- 31.85------ 3-----31.95------3-------0--------3-------0
    4---- 31.36------4-----31.83------4-----45.53------4-----(-2
    5---- 31.4-------5-----31.91 ------5-----17.5-------5-------6
    6---- 31.4-------6-----31.84 ------6-----38.52------6-------1
    7---- 31.28------7-----31.47 ------7-----100--------7-------1
    8---- 31.03 ------8-----31.46------8----94.55-------8-----(-1

    remember the workbook is in set of 2 wit 10 set or 20 columns and 10 rows per column with 15 races a night, so it is pretty long.
    Hera a copy of the code error:
    Code for this procedure exceeds 64K when compiled.
    Break this, and any other large procedures, into two or more smaller procedures.
    ---------------------------------------------
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    Range("AB160").Select
    ActiveWindow.SmallScroll Down:=114
    Range("Y262:Z270").Select
    ActiveWorkbook.Worksheets("Mor Setup").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Mor Setup").Sort.SortFields.Add Key:=Range( _
    "Z263:Z270"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("Mor Setup").Sort
    .SetRange Range("Y262:Z270")
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    Range("AC273").Select
    ActiveWindow.SmallScroll Down:=138
    End Sub

    I hope this helps and is what your asking for.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: procedure exceeds 64K

    @justme1052: I'm afraid that the information, as presented, is not very helpful. What would be more useful is a sample workbook, or the actual workbook if it does not contain any sensitive information. The code should be in the workbook.

    Please also note that, to comply with forum rules, you should also add Code Tags around your code above.

    In the meantime:

    Please Login or Register  to view this content.


    Regards, TMS

  6. #6
    Registered User
    Join Date
    05-30-2013
    Location
    Elberta, Al
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: procedure exceeds 64K

    Please before I go any further,please tell me how to get a code tag. I do not want to be no longer allow on this sight. this sight is so helpful. A couple days ago two guys name FDibbins and mike65535 spent a few hours with me talking and walking me step by step to learn how to create a macros. but with all their help, FDibbins had to click problem solved because I could not find the icon he was talking about or the star to thank them then and I still do not know where they are at. so let me go back and again read the rules. I'm not trying to use my age as a excuse but when it come to the computer stuff I do not understand all the words when asks to do this or that. but to keep from getting kicked out let me go see if I can find a code tag and a problem solved and thank you star icon. please bare with me and I'm sorry if I seem so lost, but I really am. So before you try to help me with my problem let me find the code tag and icons I need to know to follow the rules. Even when I'm not asking for help I enjoy reading the forum and learning from it I still want to come to this site, but I will learn the rules. Thank for that advice.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: procedure exceeds 64K

    Don't worry, I'm sure there are no plans to ban you.

    If you click on the edit option on the bottom right of the box where you see your text, it will open the window for you to make changes.

    If you select/highlight the code, then click on the hash (#) icon, it will put the code tags in for you. Then save your amended post.

    Regards, TMS

+ 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. When a Value exceeds limit
    By mills49 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2013, 11:16 PM
  2. [SOLVED] Create a time delay at end of procedure that will then call on next procedure
    By Clay Shooter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2013, 05:56 AM
  3. Replies: 0
    Last Post: 10-02-2012, 03:06 PM
  4. Using a variable calculated in a procedure in another procedure.
    By Trinidad3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-06-2010, 04:51 AM
  5. exceeds 6 digits
    By omabh in forum Excel General
    Replies: 1
    Last Post: 12-18-2007, 04:27 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