#1   Report Post  
aftamath
 
Posts: n/a
Default 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   Report Post  
Jim Rech
 
Posts: n/a
Default

The sub should look like this:

Private Sub Worksheet_Calculate()

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

--
Jim
"aftamath" wrote in message
...
| 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   Report Post  
aftamath
 
Posts: n/a
Default

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" wrote in message
...
| 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   Report Post  
Jim Rech
 
Posts: n/a
Default

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" wrote in message
...
| 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" wrote in message
| ...
| | 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   Report Post  
aftamath
 
Posts: n/a
Default

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" wrote in message
...
| 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" wrote in message
| ...
| | 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ignore error msgs in formula references gharden Excel Discussion (Misc queries) 4 June 17th 05 12:14 AM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 7 March 7th 05 06:29 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 0 February 28th 05 06:26 PM
Problem with VBA returning the contents of a long formula. [email protected] Excel Discussion (Misc queries) 2 February 23rd 05 12:14 AM
ERROR Pinto1uk Excel Discussion (Misc queries) 1 February 8th 05 03:15 AM


All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"