+ Reply to Thread
Results 1 to 7 of 7

Run-time error 1004 You can’t change part of an array.

  1. #1
    Registered User
    Join Date
    05-28-2016
    Location
    San Diego, CA
    MS-Off Ver
    2013
    Posts
    3

    Run-time error 1004 You can’t change part of an array.

    Dear Sir / Madam,

    I calculate some values in Spreadsheet A of a Workbook and copy the values only to spreadsheet B in the same workbook using a macro. On the second or subsequent time in which I use the macro to place the newer data in the same location in spreadsheet B by deleting some cells in rows and columns to the left of where the current data is to be stored the macro immediately shows a run-time error. The cells being removed are blank cells with no formulas or values or formatting. The first time I run the macro it works. Upon running it the second time it immediately opens a message which states “Run-time error 1004 You can’t change part of an array”.

    I am running the Excel spreadsheet on Windows 10, Excel 2016.
    None of the following work to solve the problem:

    I cannot find any GWXL97.DLA file;
    Edit Copy and Edit Paste of the highlighted cells into the same location as the cells to be deleted;
    Changing the macro to a different group of unformatted empty cells to remove produces the same error message;
    The trust settings for macros in Excel are open and macros enabled;
    Find & Select, Go to Special and Current Array says that no cells are found;
    Home and Clear Button, Clear Formats has no effect;
    F2, CTRL +X, select new location CTRL +V, CTRL+Shift + enter have no effect.

    Following is the initial code section text where the problem occurs:

    Application.Goto Reference:="R5C2"
    Range("B5:X130").Select
    Selection.Delete Shift:=xlToLeft
    Application.Goto Reference:="R5C1543"
    Range("BGI5:BHI130").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Application.Goto Reference:="Model!R[-2]C[-1538]"

    How do I remove the error message or simply bypass it as it has no meaning or use?

    Many thanks in advance for your assistance.

    Best Regards,

    Michael
    Your Message

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Run-time error 1004 You can’t change part of an array.

    Administrative Note:

    Welcome to the forum.

    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 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

    I usually do it for you the first time but cannot edit your post ( forum glitch). Please add the tags as described. Please read forum rules. Thanks

  3. #3
    Registered User
    Join Date
    05-28-2016
    Location
    San Diego, CA
    MS-Off Ver
    2013
    Posts
    3

    Re: Run-time error 1004 You can’t change part of an array.

    Run-time error 1004 You can’t change part of an array.
    Dear Sir / Madam,

    I calculate some values in Spreadsheet A of a Workbook and copy the values only to spreadsheet B in the same workbook using a macro. On the second or subsequent time in which I use the macro to place the newer data in the same location in spreadsheet B by deleting some cells in rows and columns to the left of where the current data is to be stored the macro immediately shows a run-time error. The cells being removed are blank cells with no formulas or values or formatting. The first time I run the macro it works. Upon running it the second time it immediately opens a message which states “Run-time error 1004 You can’t change part of an array”.

    I am running the Excel spreadsheet on Windows 10, Excel 2016.
    None of the following work to solve the problem:

    I cannot find any GWXL97.DLA file;
    Edit Copy and Edit Paste of the highlighted cells into the same location as the cells to be deleted;
    Changing the macro to a different group of unformatted empty cells to remove produces the same error message;
    The trust settings for macros in Excel are open and macros enabled;
    Find & Select, Go to Special and Current Array says that no cells are found;
    Home and Clear Button, Clear Formats has no effect;
    F2, CTRL +X, select new location CTRL +V, CTRL+Shift + enter have no effect.

    Following is the initial code section text where the problem occurs:

    Please Login or Register  to view this content.
    How do I remove the error message or simply bypass it as it has no meaning or use?

    Many thanks in advance for your assistance.

    Best Regards,

    Michael

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Run-time error 1004 You can’t change part of an array.

    You are deleting specific cells, rather than entire rows or columns, so perhaps you have array formulas that span the cells being deleted, which would explain the error message.
    Rory

  5. #5
    Registered User
    Join Date
    05-28-2016
    Location
    San Diego, CA
    MS-Off Ver
    2013
    Posts
    3

    Re: Run-time error 1004 You can’t change part of an array.

    Find & Select, Go to Special and Current Array says that no cells are found, it does not seem that there is any array.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Run-time error 1004 You can’t change part of an array.

    Hard to say without the workbook then.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Run-time error 1004 You can’t change part of an array.

    @rcollie
    Please add tags as requested in my post. (2nd request)
    Thanks

+ 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 1004 within Array
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 04:11 AM
  2. Run time error 1004 - macro to change font
    By mimichan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2012, 01:21 PM
  3. Find/Replace Macro Error 1004 part way though loop?
    By macronoob123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-03-2011, 06:34 PM
  4. Array loop producing error "Run time error '1004'"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-06-2011, 08:56 AM
  5. run time error 1004 when using macro to change pivot Table fields.
    By Craigs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2011, 06:19 AM
  6. Comparing a string to values in an array resulting in a Run time Error 1004
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2009, 04:21 PM
  7. run-time error 1004: Cannot change this part of a PivotTable report
    By wburbage in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2007, 10:55 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