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.
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.
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.
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.
>
>
>
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.
| >
| >
| >
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.
> | >
> | >
> | >
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks