+ Reply to Thread
Results 1 to 6 of 6

Error "There isn't enough memory to complete this action"

  1. #1
    Registered User
    Join Date
    10-19-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    5

    Error "There isn't enough memory to complete this action"

    Hi,
    I have a simple macro to copy a sheet and to paste that to new sheet added to after sheet1. Whenever I use data range A1 to F51, an error "There isn't enough memory to complete this action" occurs. But if I replace range with entire sheet it works. Can anyone tell me why vba can copy entire sheet but can not copy range A1 to F51. In this sheet there are only formulae are sums. No bigger of complicated formulae.

    Following works:
    Sub CopySheet()

    Sheet1.Cells.Copy
    Sheets.Add after:=Worksheets(Sheets.Count)
    ActiveSheet.Name = Sheet1.Cells(2, "A")
    ActiveSheet.Cells.PasteSpecial xlPasteFormats
    ActiveSheet.Cells.PasteSpecial xlPasteValues

    End Sub

    Following does not working

    Sub CopySheet()

    Sheet1.Range("A1:F51").Copy
    Sheets.Add after:=Worksheets(Sheets.Count)
    ActiveSheet.Name = Sheet1.Cells(2, "A")
    ActiveSheet.Cells.PasteSpecial xlPasteFormats
    ActiveSheet.Cells.PasteSpecial xlPasteValues

    End Sub

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Error "There isn't enough memory to complete this action"

    Please attach your file with the issue in such a way it is possible to reproduce the error
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Error "There isn't enough memory to complete this action"

    Maybe it's trying to paste A1:F51 to every cell in the destination sheet?

    Try
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Error "There isn't enough memory to complete this action"

    Administrative Note:

    YOU HAVE BEEN TOLD THIS BEFORE


    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then 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

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    10-19-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    5

    Re: Error "There isn't enough memory to complete this action"

    Okey,
    Thanks

  6. #6
    Registered User
    Join Date
    10-19-2022
    Location
    India
    MS-Off Ver
    2016
    Posts
    5

    Re: Error "There isn't enough memory to complete this action"

    Thank you that works

+ 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. Replies: 3
    Last Post: 02-23-2023, 12:00 PM
  2. [SOLVED] Error - "There isn't enough memory to complete this action."
    By artiststevens in forum Excel General
    Replies: 7
    Last Post: 07-12-2022, 11:28 AM
  3. VBA Code causes error: “There isn't enough memory to complete this action.”
    By dubumochi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2019, 07:30 AM
  4. Excel 2013 "not enough memory to complete action"
    By ccruse in forum Excel General
    Replies: 4
    Last Post: 12-16-2015, 11:29 AM
  5. how to solve error as "excel is waiting for another app to complete an ole action"
    By bhuvana86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-29-2015, 12:38 PM
  6. There isn't enough memory to complete this action.
    By matrix2280 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2015, 12:51 PM
  7. There isn"t enough memory to complete this action
    By Tyso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 01:31 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