+ Reply to Thread
Results 1 to 10 of 10

VBA Out of Stack Space Error 28

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    VBA Out of Stack Space Error 28

    I have a drop down list with 8 options. When you select an option I want data from another sheet on the workbook to be copied and pasted onto sheet one. I have done this using 8 separate macro's I recorded. Any help would be great? See below my code:

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 10-13-2015 at 06:43 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA Out of Stack Space Error 28

    Hi, and welcome to the forum. UnfortunatelyYour post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Since this is your first post I'll change it for you but please note for the future.

    This is difficult to answer with certainty since we have no ideas what your macros are doing. I'm guessing that there is a lot of looping with variable values being popped into the memory stack without being removed thus overloading it. So upload your workbook so that we may see your request in context.

    It's also likely that if you are using loops there might be a more efficient method using perhaps filtering.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-12-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Out of Stack Space Error 28

    I have tried putting in application.enableevents=false but think I am putting it in the wrong place as now it does not copy and paste anything.

    Thanks

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Out of Stack Space Error 28

    Turn off events at the start of the code and turn them back on at the end.
    Please Login or Register  to view this content.
    By the way, do you want this code to execute whenever any change is made in any sheet on any worksheet or only when a certain range/cell is changed?


    PS Can you add code tags when posting code?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    10-12-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Out of Stack Space Error 28

    Macro is as follows


    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Out of Stack Space Error 28

    That code can be reduced to this.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-12-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Out of Stack Space Error 28

    Thank you it works!

    only want it to change when the drop down list is change in cell F11. If that makes any difference?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Out of Stack Space Error 28

    This code will only get fully executed if F11 has been changed.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-12-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Out of Stack Space Error 28

    Great, Thank you!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA Out of Stack Space Error 28

    Just out of interest do the macros contain loops which are copying and pasting single rows each pass through the loop?

+ 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. Out of stack space error
    By lazyengineer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2015, 02:24 PM
  2. [SOLVED] Run TIme Error 28: Out of Stack Space
    By smciesl2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2014, 01:21 PM
  3. Run Time Error 28: Out of Stack Space
    By Shanahan0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2013, 10:42 AM
  4. Run-time error '28' Out of stack space
    By pinkpantherksa in forum Excel General
    Replies: 1
    Last Post: 12-13-2012, 06:33 PM
  5. Excel Error: 28 Out of Stack space
    By AinMn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2010, 01:24 AM
  6. Out of stack space error
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-20-2008, 03:47 PM
  7. [SOLVED] 'Out of stack space' error on SaveAs
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2005, 01:05 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