+ Reply to Thread
Results 1 to 4 of 4

Error 1004 when using Range(Cells(1,1),Cells(2,2)) format.

  1. #1
    Registered User
    Join Date
    03-06-2015
    Location
    Newcastle, England
    MS-Off Ver
    2013
    Posts
    26

    Error 1004 when using Range(Cells(1,1),Cells(2,2)) format.

    Hi all,

    I'm almost certain this has been answered before but couldn't for the life of me find a solved post on this... my code is below but when I run it I get:

    'Run-time error '1004': Application-defined or object defined error'.

    Code:

    Please Login or Register  to view this content.
    The tablerows and rawrows integer values are 1178 and 100 respectively.

    I'm certain there's an easy solution to this but I've been stressing over this for hours and I'm on the verge of a mental breakdown - any help would be greatly appreciated.

    Cheers,

    Chris
    Last edited by JBeaucaire; 07-24-2016 at 09:21 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Error 1004 when using Range(Cells(1,1),Cells(2,2)) format.

    I'm hoping the "select" thing is just for the sake of this question. In VBA you almost never need to "select" something prior to acting on it, only humans need to do that, VBA does not. Anyway, my suggestion:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Error 1004 when using Range(Cells(1,1),Cells(2,2)) format.

    @TheClaw2323, Jerry's code might have solved your issue but if not are you sure the error isn't 'Run-time error '1004': Select method of Range class failed' and is Worksheets("Sold & Confirmed Unsold") the activesheet (I am assuming the Select was actually in your actual code)?
    Last edited by WasWodge; 07-24-2016 at 09:35 AM. Reason: amended after reading Jerry's response posted whilst typing
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  4. #4
    Registered User
    Join Date
    03-06-2015
    Location
    Newcastle, England
    MS-Off Ver
    2013
    Posts
    26

    Re: Error 1004 when using Range(Cells(1,1),Cells(2,2)) format.

    Hi both,

    Thanks very much for the responses. No sorry my actual code is .Copy not .Select but Jerry your suggestion has worked!

    Thanks for the help guys

+ 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: 11-27-2015, 01:58 PM
  2. [SOLVED] Range(Cells(a,b),Cells(c,d)) Only Works if Sheet is Active?? (Error 1004)
    By Merf in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-15-2015, 06:03 PM
  3. [SOLVED] Error 1004: Application-defined or object-defined error on Range(Cells(x,y)) syntax
    By winch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-04-2013, 11:02 AM
  4. Error 1004 when selecting a range of cells
    By isrisian in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2011, 07:01 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. Worksheet.Range(Cells(r,c),Cells(r,c)) & error 1004
    By onebir in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2007, 05:10 AM
  7. [SOLVED] Charting - Cells and Range - Error 1004
    By vbaprog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2005, 04:06 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