+ Reply to Thread
Results 1 to 8 of 8

Rows(Cells(), Cells()) run-time error 1004

  1. #1
    Registered User
    Join Date
    08-31-2018
    Location
    San Diego
    MS-Off Ver
    1803
    Posts
    7

    Rows(Cells(), Cells()) run-time error 1004

    Hi all,

    I've been trying to debug this one chunk of code for way too long:
    Please Login or Register  to view this content.
    My goal is just to append ranges to rng with the Union function and delete them. I keep getting run-time error 1004 on the line in bold, however.
    Any help is much appreciate, thanks!
    Last edited by alansidman; 04-22-2019 at 01:57 PM.

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

    Re: Rows(Cells(), Cells()) run-time error 1004

    Is rng not empty ??
    Before to use the union set rng to an existing range
    Something like

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    18,532

    Re: Rows(Cells(), Cells()) run-time error 1004

    Code Tags Added
    Your post does not comply with Rule 2 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 at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  4. #4
    Registered User
    Join Date
    08-31-2018
    Location
    San Diego
    MS-Off Ver
    1803
    Posts
    7

    Re: Rows(Cells(), Cells()) run-time error 1004

    I did try that earlier and got the same error... Just attempted again to make sure, and got the error again. (See error in attached image)

    Please Login or Register  to view this content.
    Attachment 621072
    Last edited by art3mis; 04-22-2019 at 02:04 PM.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,472

    Re: Rows(Cells(), Cells()) run-time error 1004

    What is the value of LastRow?

  6. #6
    Registered User
    Join Date
    08-31-2018
    Location
    San Diego
    MS-Off Ver
    1803
    Posts
    7

    Re: Rows(Cells(), Cells()) run-time error 1004

    lastRow = 635, it's the number of rows of data in each column

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,472

    Re: Rows(Cells(), Cells()) run-time error 1004

    What is the actual error message?
    Also what is the value of i when it fails?

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,492

    Re: Rows(Cells(), Cells()) run-time error 1004

    Did you check, using .select that each range in the UNION is OK ?

+ 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: 2
    Last Post: 01-06-2017, 01:30 AM
  2. [SOLVED] run time error 1004 no cells were found
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2014, 04:13 PM
  3. [SOLVED] Run Time Error Message 1004 : No Cells were found
    By brajpalshishodia in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-15-2012, 12:52 PM
  4. Run-time error '1004': No cells were found
    By tirk82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 12:48 PM
  5. range(cells(),cells()) from 2 different workbooks, run time error 1004
    By sam0287 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2010, 05:46 AM
  6. Merge Cells run-time error '1004'
    By darxoul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2006, 10:10 AM
  7. [SOLVED] Run-time error '1004': No cells were found
    By Jamie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2005, 06:06 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