+ Reply to Thread
Results 1 to 5 of 5

Unknown Error

  1. #1
    aftamath
    Guest

    Unknown Error

    What does"Procedure declaration does not match description of event or
    procedure having the same name" mean. I'm under Private Sub
    Worksheet_Calculate in VBA.

  2. #2
    Jim Rech
    Guest

    Re: Unknown Error

    The sub should look like this:

    Private Sub Worksheet_Calculate()

    The error message suggests that you've modified it in some way.

    --
    Jim
    "aftamath" <[email protected]> wrote in message
    news:[email protected]...
    | What does"Procedure declaration does not match description of event or
    | procedure having the same name" mean. I'm under Private Sub
    | Worksheet_Calculate in VBA.



  3. #3
    aftamath
    Guest

    Re: Unknown Error

    I'm still getting the same message, here's the code:

    Private Sub Worksheet_Calculate(ByVal Target As Range)

    If Not Application.Intersect(Range("R2"), Target) Is Nothing Then

    intRow = (Range("W2") - Target.Value) / 0.0001

    MsgBox intRow

    End If
    End Sub

    I only get that message when I used the Calculate procedure.

    "Jim Rech" wrote:

    > The sub should look like this:
    >
    > Private Sub Worksheet_Calculate()
    >
    > The error message suggests that you've modified it in some way.
    >
    > --
    > Jim
    > "aftamath" <[email protected]> wrote in message
    > news:[email protected]...
    > | What does"Procedure declaration does not match description of event or
    > | procedure having the same name" mean. I'm under Private Sub
    > | Worksheet_Calculate in VBA.
    >
    >
    >


  4. #4
    Jim Rech
    Guest

    Re: Unknown Error

    Right, so this:

    Private Sub Worksheet_Calculate(ByVal Target As Range)

    does not follow the prototype:

    Private Sub Worksheet_Calculate()

    You can't just add "ByVal Target As Range". Are you confusing this with the
    Worksheet_Change event?

    --
    Jim
    "aftamath" <[email protected]> wrote in message
    news:[email protected]...
    | I'm still getting the same message, here's the code:
    |
    | Private Sub Worksheet_Calculate(ByVal Target As Range)
    |
    | If Not Application.Intersect(Range("R2"), Target) Is Nothing Then
    |
    | intRow = (Range("W2") - Target.Value) / 0.0001
    |
    | MsgBox intRow
    |
    | End If
    | End Sub
    |
    | I only get that message when I used the Calculate procedure.
    |
    | "Jim Rech" wrote:
    |
    | > The sub should look like this:
    | >
    | > Private Sub Worksheet_Calculate()
    | >
    | > The error message suggests that you've modified it in some way.
    | >
    | > --
    | > Jim
    | > "aftamath" <[email protected]> wrote in message
    | > news:[email protected]...
    | > | What does"Procedure declaration does not match description of event or
    | > | procedure having the same name" mean. I'm under Private Sub
    | > | Worksheet_Calculate in VBA.
    | >
    | >
    | >



  5. #5
    aftamath
    Guest

    Re: Unknown Error

    I'm just new to this code, so i'm not sure of prototype, but that's been the
    problem. Thanks, that explains it.

    "Jim Rech" wrote:

    > Right, so this:
    >
    > Private Sub Worksheet_Calculate(ByVal Target As Range)
    >
    > does not follow the prototype:
    >
    > Private Sub Worksheet_Calculate()
    >
    > You can't just add "ByVal Target As Range". Are you confusing this with the
    > Worksheet_Change event?
    >
    > --
    > Jim
    > "aftamath" <[email protected]> wrote in message
    > news:[email protected]...
    > | I'm still getting the same message, here's the code:
    > |
    > | Private Sub Worksheet_Calculate(ByVal Target As Range)
    > |
    > | If Not Application.Intersect(Range("R2"), Target) Is Nothing Then
    > |
    > | intRow = (Range("W2") - Target.Value) / 0.0001
    > |
    > | MsgBox intRow
    > |
    > | End If
    > | End Sub
    > |
    > | I only get that message when I used the Calculate procedure.
    > |
    > | "Jim Rech" wrote:
    > |
    > | > The sub should look like this:
    > | >
    > | > Private Sub Worksheet_Calculate()
    > | >
    > | > The error message suggests that you've modified it in some way.
    > | >
    > | > --
    > | > Jim
    > | > "aftamath" <[email protected]> wrote in message
    > | > news:[email protected]...
    > | > | What does"Procedure declaration does not match description of event or
    > | > | procedure having the same name" mean. I'm under Private Sub
    > | > | Worksheet_Calculate in VBA.
    > | >
    > | >
    > | >
    >
    >
    >


+ 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