+ Reply to Thread
Results 1 to 4 of 4

Cells() in Range Run-time Error

  1. #1
    Registered User
    Join Date
    06-06-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    2

    Cells() in Range Run-time Error

    I'm trying to set a range to a value using the Cells property, but keep getting a "Run-time error '1004': Application-defined or object-defined error" at the Set OrderRange line.

    Please Login or Register  to view this content.
    I've tried simplifying it to just numbers instead of a variable in the Cells arguments but it still does the same. Replacing the Cells property and using a direct cell reference (i.e. A8 etc.) works fine.

    This is in a module created by right-clicking VBAPRoject (Workbookname)>Insert>Module in the project explorer.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,528

    Re: Cells() in Range Run-time Error

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-06-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    2

    Re: Cells() in Range Run-time Error

    Thank you! This way seems pretty simple, had no idea you could do that .

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,528

    Re: Cells() in Range Run-time Error

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Run-time error '5' when copying range of cells to different sheet
    By Meriwether in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2014, 02:55 PM
  3. [SOLVED] Run-time error '9': subscript out of range - error occurs on multiple computers except one
    By BrettE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2014, 11:19 PM
  4. Trying to clear a range of cells but getting a run time error
    By chemeng1T4 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 06:00 AM
  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. using cells to define range gives run time error
    By dudamel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2010, 10:48 AM
  7. [SOLVED] How do you sum a range of more than 30 cells. I get error each time I try.
    By Joseph Conaghan via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2005, 07: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