+ Reply to Thread
Results 1 to 8 of 8

Application-defined object error

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Application-defined object error

    I am trying to write a simple script that just gets the value from the same cell on 52 sheets and puts them into a column, but I am really struggling, I am having difficulty accessing cell addresses using VBA, it's easy using just formulas but in VBA it seems a little more complex.

    This is what I have so far:

    Please Login or Register  to view this content.
    This generates an application-defined object error for some reason.
    What is the syntax to address this correctly.

    Regards

    Rob

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Application-defined object error

    This won't cause an error but I'm not sure it'll do exactly what you want.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Application-defined object error

    Try this

    Please Login or Register  to view this content.
    Norie beat me to it... I think it was erroring because worksheets(i) is not a valid reference as a formula in excel. If you tried to type that in the cell manually it would also error out.
    Last edited by Hawkeye16; 05-21-2014 at 04:42 AM.

  4. #4
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Re: Application-defined object error

    Hmm, The R1C1 is confusing the heck out of me is there a way of doing this without the R1C1 addressing method?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Application-defined object error

    Probably, what should the cell reference be? Is it the same for each sheet?

  6. #6
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Re: Application-defined object error

    Yes, it is I94 on every sheet.

  7. #7
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Application-defined object error

    The R1C1 uses relative values so each time you move down a cell in the TOTAL tab to write a new formula, the R[92] also moves down a row. If this is what you want it can also be done by using the offset function and your variable i. If you want it to be the same cell on each tab then just reference that cell instead of the R1C1 part of the formula.

    Please Login or Register  to view this content.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Application-defined object error

    All you need is this then.
    Please Login or Register  to view this content.

+ 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: 1
    Last Post: 03-12-2014, 12:42 PM
  2. [SOLVED] Run time error 1004 Application-Defined or Object-Defined Error - Placing data into next e
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-27-2014, 12:57 PM
  3. [SOLVED] run-time error '1004' application-defined or object-defined error - Excel 2007
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 02:46 AM
  4. Replies: 2
    Last Post: 09-12-2012, 01:01 PM
  5. Replies: 0
    Last Post: 05-14-2012, 11:59 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