Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why error '91' (2000 sr 1)

    i have this code, but have the error 91 in commented line of code.

    Ridiculously long code fragment moved to attachment by HansV (together with Italian error message)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Why error '91' (2000 sr 1)

    You set the oCell variable within an If ... End If block:

    If OggettoRecordset("PROVA1") <> 1 Then
    ...
    Set oCell = Worksheets("TABELLA").Range("A:A").Find(...
    ...
    End If

    The line that causes the error is outside the If ... End If block, but it refers to oCell. If the condition in the If ... Then line is not true, oCell is not set, so oCell.Offset(0, 8) is not valid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •