![]() |
Changing Value
Hi
I have a cell that has a value that changes every second, every time this value changes I need to update values in three other cells, ie A1 to A3 by adding one to there existing values. When I try Worksheet Calculate or Change I sometimes get multiple updates instead of the single event I require. Any Ideas Thanks Alec |
Changing Value
What causes the value of the cell to change every second? perhaps you can
simply increment the cells from there. or perhaps try this Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then Set myrange = Range("A1:A3") For Each c In myrange c.Value = c.Value + 1 Next End If End Sub This assumes you update a second cell is A4 Mike "Alectrical" wrote: Hi I have a cell that has a value that changes every second, every time this value changes I need to update values in three other cells, ie A1 to A3 by adding one to there existing values. When I try Worksheet Calculate or Change I sometimes get multiple updates instead of the single event I require. Any Ideas Thanks Alec |
Changing Value
Alec,
I hope this helpfull: Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range If Target.Address = "$B$1" Then For Each rng In Range("A1:A3") If IsNumeric(rng) Then rng = rng + 1 Next rng End If End Sub change "$B$1" to suit your range to fire worksheet_change -- Regards, Halim "Alectrical" wrote: Hi I have a cell that has a value that changes every second, every time this value changes I need to update values in three other cells, ie A1 to A3 by adding one to there existing values. When I try Worksheet Calculate or Change I sometimes get multiple updates instead of the single event I require. Any Ideas Thanks Alec |
Changing Value
Thanks Halim
"Halim" wrote: Alec, I hope this helpfull: Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range If Target.Address = "$B$1" Then For Each rng In Range("A1:A3") If IsNumeric(rng) Then rng = rng + 1 Next rng End If End Sub change "$B$1" to suit your range to fire worksheet_change -- Regards, Halim "Alectrical" wrote: Hi I have a cell that has a value that changes every second, every time this value changes I need to update values in three other cells, ie A1 to A3 by adding one to there existing values. When I try Worksheet Calculate or Change I sometimes get multiple updates instead of the single event I require. Any Ideas Thanks Alec |
Changing Value
Thanks Mike
"Mike H" wrote: What causes the value of the cell to change every second? perhaps you can simply increment the cells from there. or perhaps try this Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then Set myrange = Range("A1:A3") For Each c In myrange c.Value = c.Value + 1 Next End If End Sub This assumes you update a second cell is A4 Mike "Alectrical" wrote: Hi I have a cell that has a value that changes every second, every time this value changes I need to update values in three other cells, ie A1 to A3 by adding one to there existing values. When I try Worksheet Calculate or Change I sometimes get multiple updates instead of the single event I require. Any Ideas Thanks Alec |
All times are GMT +1. The time now is 10:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com