View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
New Ton[_2_] New Ton[_2_] is offline
external usenet poster
 
Posts: 10
Default Challenge with target output

Don't now if I am asking the right questions here, but when i change code to
this;

Private Sub Worksheet_Calculate(ByVal Target As Range)
If Application.Intersect(Range("g5:g29"), Target) Is Nothing Then
Range("g31").Value = Target
End If
End Sub

I get this compile error: 'Procedure declaration does not match
description...'

Do i need to change code completely or is it something in the declaration
and in that case, what?

Thank you:)

"Gary''s Student" wrote:

You need a different Event Macro.

The Change event traps changes due to typeing or pasting. The Calculate
event responds to calculation changes.
--
Gary''s Student - gsnu200798


"New Ton" wrote:

Hello everyone.

When added, this code inputs changed values in a range ("g5:g29") to
specified ("g31") cell:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("g5:g29"), Target) Is Nothing Then
Range("g31").Value = Target
End If
End Sub

When formula =IF(C6+E6=0;"";B6-C6+E6) was added to "g6", i hoped this result
would generate input in"g31", if input in "c6" or "e6" (due to code), but
only values from either"c6" or "e6" seem to be added.

What am I doing wrong?

Thanks in advance:)