#1   Report Post  
Posted to microsoft.public.excel.misc
Chey
 
Posts: n/a
Default Change value in cell

I have cells

G2
G4
G13
G14

when I change the value in any of these I would like it to change in all 4
ex. If I change G2 to 65 then G4,G13,G14 will be 65
If I change G4, then the rest will change. and so on. I only need these 4
to be the same.

I was going to do the =G2, but I can't do that. I don't know which cell
they are going to change. They are using this for a cost presentation. I am
leting people use this that have no clue about formulas and will get
frustrated, if it does not work.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Change value in cell

'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "G2,G4,G13,G14"
Dim sTemp
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(target, Me.Range(WS_RANGE)) Is Nothing Then
sTemp = target.Value
For Each cell In Range(WS_RANGE)
cell.Value = sTemp
Next cell
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Chey" wrote in message
...
I have cells

G2
G4
G13
G14

when I change the value in any of these I would like it to change in all 4
ex. If I change G2 to 65 then G4,G13,G14 will be 65
If I change G4, then the rest will change. and so on. I only need these 4
to be the same.

I was going to do the =G2, but I can't do that. I don't know which cell
they are going to change. They are using this for a cost presentation. I

am
leting people use this that have no clue about formulas and will get
frustrated, if it does not work.
Thanks.



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
Can function in one cell change value or function in another cell? me Excel Worksheet Functions 4 February 27th 06 02:04 PM
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 03:41 PM
Cell Change Color - Need Help alani New Users to Excel 3 June 29th 05 03:50 PM
Cell references change when entering new data [email protected] New Users to Excel 2 May 6th 05 07:48 PM
Look for change next blank cell in Range Nigel Bennett Excel Worksheet Functions 1 March 13th 05 10:45 PM


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