Hi
looking for some guidance on the following any help much appreciated.
I have spreadsheet (sheet1) reading live data from instruments approx 1-2 times a second, the data is placed into cells A1-A230.
One piece of data, in cell A2 is digital should it value change from 0 to 1 then i wish to use it as a trigger to set off a macro.
I tried to use worksheet Private Sub Worksheet_Change(ByVal target As Range) within the sheets1's code
Private Sub Worksheet_Change(ByVal target As Range)
If Target.Address = "$B$15" Then
If target <> old_value Then
'a change has occured in cell C7 so do your processing....
Call test
old_value = ActiveSheet.Range("$b$15")
Else
End If
endif
End Sub
with target set to "A2", the code runs ok, but whilst debugging i noticed
everytime any cell changes the Private Sub Worksheet_Change(ByVal target As Range) routine is called and then jumps out as a result of the if statements, but just calling the routine when operating normally as the instrument data is streaming in this code is continiously running and affecting excels ability to keep up with further supplementary calculations.
is there an alternative to "Private Sub Worksheet_Change" that only ever assesses one cell (A2)? or a way i can code this more effieciently
many thanks
looking for some guidance on the following any help much appreciated.
I have spreadsheet (sheet1) reading live data from instruments approx 1-2 times a second, the data is placed into cells A1-A230.
One piece of data, in cell A2 is digital should it value change from 0 to 1 then i wish to use it as a trigger to set off a macro.
I tried to use worksheet Private Sub Worksheet_Change(ByVal target As Range) within the sheets1's code
Private Sub Worksheet_Change(ByVal target As Range)
If Target.Address = "$B$15" Then
If target <> old_value Then
'a change has occured in cell C7 so do your processing....
Call test
old_value = ActiveSheet.Range("$b$15")
Else
End If
endif
End Sub
with target set to "A2", the code runs ok, but whilst debugging i noticed
everytime any cell changes the Private Sub Worksheet_Change(ByVal target As Range) routine is called and then jumps out as a result of the if statements, but just calling the routine when operating normally as the instrument data is streaming in this code is continiously running and affecting excels ability to keep up with further supplementary calculations.
is there an alternative to "Private Sub Worksheet_Change" that only ever assesses one cell (A2)? or a way i can code this more effieciently
many thanks