Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default trigger problem


Hi,

I want to trigger a script whenever the data changes in a cell.
For testing purposes I used this little script:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("c1")) Is Nothing Then
Range("a1") = 1
End If
End Sub

The problem:
If I type something in c1 everything goes ok
But when I put this in c1= e1 and change the data in e1, c1 changes but
nothing happens to a1

How can I trigger the script thru a link that changes?

Thanks


--
climax
------------------------------------------------------------------------
climax's Profile: http://www.excelforum.com/member.php...o&userid=30816
View this thread: http://www.excelforum.com/showthread...hreadid=507580

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default trigger problem

Hi Cilimax,

If the value of C1 depends on E1, try changing:

If Not Intersect(Target, Range("c1")) Is Nothing Then


to

If Not Intersect(Target, Range("E1")) Is Nothing Then



---
Regards,
Norman



"climax" wrote in
message ...

Hi,

I want to trigger a script whenever the data changes in a cell.
For testing purposes I used this little script:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("c1")) Is Nothing Then
Range("a1") = 1
End If
End Sub

The problem:
If I type something in c1 everything goes ok
But when I put this in c1= e1 and change the data in e1, c1 changes but
nothing happens to a1

How can I trigger the script thru a link that changes?

Thanks


--
climax
------------------------------------------------------------------------
climax's Profile:
http://www.excelforum.com/member.php...o&userid=30816
View this thread: http://www.excelforum.com/showthread...hreadid=507580



  #3   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 7
Default trigger problem

You can use this code snippet:
***
Private Sub Worksheet_Change(ByVal Target As Range)

If Range("C3").Formula = "=" & Mid(Target.AddressLocal, 2, 1) &
Target.Row & "" Then
Range("A1") = 3
End If

End Sub
***

If the cell (address) changes that has been referenced (in this case in
'C3') then cell 'A1' has value of 3.
I tested briefly and it seems to work.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default trigger problem


Thanks JK
I´m one step closer now but the problem is I get data for forex trading
into my exel sheet. The formula for cell c3 is: =IQLink|heurusd!ASK
I get the askprice from euro vs dollar from an extern prog in cell c3.
The data changes constant +- once a second. I think that the problem is
there is a formula in cell c3 and exel won´t recognise the data change.
It only sees the formula and no value. Is there a way around this ?

thanks


--
climax
------------------------------------------------------------------------
climax's Profile: http://www.excelforum.com/member.php...o&userid=30816
View this thread: http://www.excelforum.com/showthread...hreadid=507580

  #5   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 7
Default trigger problem

ok I see. Well I don't access to Reuters/Bloomberg/similar on my
present job
but here's what I drafted.
Instead of selection/worksheet changes I used 'Calculate' as trigger.
It works when I press F9 to calculate manually.
I hope it works with outside feed too.

***
Option Explicit
Dim vPreValue As Variant

Private Sub Worksheet_Calculate()

If Range("C3").Value < vPreValue Then
Range("A1") = "Changed!"
Else
Range("A1") = ""
End If

vPreValue = Range("C3").Value
End Sub
***

regs,
JK

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
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
trigger problem climax Excel Discussion (Misc queries) 1 February 2nd 06 12:39 AM
Another way to trigger a macro? Leon[_5_] Excel Programming 1 December 22nd 05 06:03 AM
Excel VBA event trigger problem Milli[_2_] Excel Programming 4 April 26th 04 08:46 AM
Macro trigger? No Name Excel Programming 3 February 29th 04 05:24 PM


All times are GMT +1. The time now is 07:26 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"