+ Reply to Thread
Results 1 to 7 of 7

Bad Coding - Run-Time Error '7' Out Of Memory

  1. #1
    Registered User
    Join Date
    12-16-2015
    Location
    placentia, california
    MS-Off Ver
    2010
    Posts
    4

    Bad Coding - Run-Time Error '7' Out Of Memory

    Hi,

    I am having trouble with my coding as below. My Code work fine but when I select all cell, I get the Run-Time Error '7' Out of Memory message. Can anyone help me clean up my code to avoid that? I am a beginner so please make provide simple explanation if possible. Thank you.


    Please Login or Register  to view this content.
    Error 7.jpg
    Last edited by trystiki; 12-30-2015 at 11:53 AM. Reason: Fix Code Format

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    Hi trystiki and welcome to the board.
    We have a rule about code tags. Please choose to edit your first post, then select all your code hit the # on the toolbar and then click save changes.

    Your code will then look like this.
    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    If by select all you mean you are clicking the upper left hand corner of the spreadsheet to select all the cells at once, then you are getting that error because there are millions of cells on a spreadsheet and you are overloading the computer. I tried it and that's what happens to me.

    You are using the selection change event, which means when you select a cell or cells on a spreadsheet that code fires. If you select more than one cell, only the upper left hand cell of the selection is considered the target and only the value in that one cell will be passed to your variable.

    If you explain what it is you want to do, then perhaps there is another solution.

    A question I have would be if you are selecting every single cell on the spreadsheet, why?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    Hi trystiki

    Welcome to the Forum!!!

    Try this...
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    12-16-2015
    Location
    placentia, california
    MS-Off Ver
    2010
    Posts
    4

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    Quote Originally Posted by skywriter View Post
    If by select all you mean you are clicking the upper left hand corner of the spreadsheet to select all the cells at once, then you are getting that error because there are millions of cells on a spreadsheet and you are overloading the computer. I tried it and that's what happens to me.

    You are using the selection change event, which means when you select a cell or cells on a spreadsheet that code fires. If you select more than one cell, only the upper left hand cell of the selection is considered the target and only the value in that one cell will be passed to your variable.

    If you explain what it is you want to do, then perhaps there is another solution.

    A question I have would be if you are selecting every single cell on the spreadsheet, why?
    Hi Skywriter, thank you for the warm welcome, your explanation, and showing me the rope on this forum. I want to create a log-sheet that keep track of all the changes being made within the workbook. I don't need to select every single cell but it is still bad coding and I want to know how to fix it. Thank you for your help.

  6. #6
    Registered User
    Join Date
    12-16-2015
    Location
    placentia, california
    MS-Off Ver
    2010
    Posts
    4

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    Quote Originally Posted by jaslake View Post
    Hi trystiki

    Welcome to the Forum!!!

    Try this...
    Please Login or Register  to view this content.
    Hi Jaslake, that did fix the run-time Error '7' but now I get run-time Error '6': overflow instead...

  7. #7
    Registered User
    Join Date
    12-16-2015
    Location
    placentia, california
    MS-Off Ver
    2010
    Posts
    4

    Re: Bad Coding - Run-Time Error '7' Out Of Memory

    It's still bad coding but the solution below worked for me. Thank you for all the help.


    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)

Similar Threads

  1. [SOLVED] Run-Time error '7' Out of Memory
    By smciesl2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2014, 01:50 PM
  2. [SOLVED] Run-time error '7': Out of memory
    By jitte in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2013, 06:14 AM
  3. Run Time error 7 - out of memory
    By sfw1973 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2013, 11:55 AM
  4. [SOLVED] Run-time error 7: out of memory
    By gandrea in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2012, 08:16 PM
  5. [SOLVED] Run-time error 7 out of memory vba
    By Jovica in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2012, 09:08 AM
  6. Run-time error 7 out of memory vba
    By Macro1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2010, 09:42 AM
  7. Run-time error '7': Out of memory
    By rpollard001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2006, 04:45 PM
  8. Run-time error '7': Out of memory
    By rpollard001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2006, 02:15 AM

Tags for this Thread

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