+ Reply to Thread
Results 1 to 11 of 11

Application defined or object defined error

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Application defined or object defined error

    Hello

    I have a problem. I write a code, and to this line thow it to me an exception:

    If ActiveSheet.Range("I3:I").Value = 1 Then

    But I don't know why.

    but if i write this

    If forras.Range("I3:I").Value = 1 Then

    (Set forras = ThisWorkbook.Worksheets("Book1") )

    it throw this exception:

    "Method 'range' of object '_Worksheet' failed

    what do i did wrong?

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Application defined or object defined error

    Your range must either be a full column (Range("I:I")), or you need to specify BOTH start and end rows (Range("I3:I1000")).

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Re: Application defined or object defined error

    if i do what you said, it's throw this:

    runtime error 13:
    type mismatch

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Application defined or object defined error

    Where? Post the modified code that errors.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or object defined error

    you can't test a range of cells against one value so
    Please Login or Register  to view this content.
    won't work. probably help if you explained what you're doing.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Re: Application defined or object defined error

    Every version throw the runtime error 13

    If forras.Range("I:I").Value = 1 Then

    If forras.Range("I3:I3000").Value = 1 Then

    If ActiveSheet.Range("I:I").Value = 1 Then

    If ActiveSheet.Range("I3:I3000").Value = 1 Then

  7. #7
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Re: Application defined or object defined error

    i would like to do this

    Please Login or Register  to view this content.

    (Set forras = ThisWorkbook.Worksheets("Book1"))

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or object defined error

    still ain't clear. do you want to add that formula for each row where column I is 1 or to all rows if any value in I is 1?

  9. #9
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Re: Application defined or object defined error

    to all rows in column I where the value is 1

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or object defined error

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-08-2012
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    33

    Re: Application defined or object defined error

    it's working, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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