Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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



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
Changing the range for averages with out changing the formula. JessLRC Excel Worksheet Functions 0 April 20th 10 03:10 PM
Changing background colour when changing data in a cell Paoul Excel Discussion (Misc queries) 7 December 26th 08 07:25 AM
Changing footers on all worksheets without changing print set up KC Excel Discussion (Misc queries) 1 October 26th 07 03:31 PM
Changing background color when changing value [email protected] Excel Programming 9 July 6th 06 01:02 PM
Changing format of number without changing the value sweetsue516 Excel Discussion (Misc queries) 2 August 22nd 05 04:07 PM


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

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

About Us

"It's about Microsoft Excel"