Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How can i look at multiple cells in a column and if any of the values change
then add them or take them away from a another cell in a different column Thankyou |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use an event macro.
Assume the range of interest is A1:A100 (adjust to suit) and cell to change is C10. Amend logic to determine add /subtraction Select the sheet where you want this to happen. Right click the sheet tab and select View Code. Paste this code into the window that opens. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo ErrHandler Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Range("C10")= Range("C10")+Target.value End If ErrHandler: Application.EnableEvents = True End Sub Hit ALT Q to return to Excel. HTH "RobG2007" wrote: How can i look at multiple cells in a column and if any of the values change then add them or take them away from a another cell in a different column Thankyou |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
that helps alot thankyou very much , how would i do the same if my range is
on a different worksheet ? thankyou "Toppers" wrote: You could use an event macro. Assume the range of interest is A1:A100 (adjust to suit) and cell to change is C10. Amend logic to determine add /subtraction Select the sheet where you want this to happen. Right click the sheet tab and select View Code. Paste this code into the window that opens. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo ErrHandler Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Range("C10")= Range("C10")+Target.value End If ErrHandler: Application.EnableEvents = True End Sub Hit ALT Q to return to Excel. HTH "RobG2007" wrote: How can i look at multiple cells in a column and if any of the values change then add them or take them away from a another cell in a different column Thankyou |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This code needs to be on the same worksheet as the data that is changed;
hence why you have to select the tab and copy the code. "RobG2007" wrote: that helps alot thankyou very much , how would i do the same if my range is on a different worksheet ? thankyou "Toppers" wrote: You could use an event macro. Assume the range of interest is A1:A100 (adjust to suit) and cell to change is C10. Amend logic to determine add /subtraction Select the sheet where you want this to happen. Right click the sheet tab and select View Code. Paste this code into the window that opens. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo ErrHandler Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Range("C10")= Range("C10")+Target.value End If ErrHandler: Application.EnableEvents = True End Sub Hit ALT Q to return to Excel. HTH "RobG2007" wrote: How can i look at multiple cells in a column and if any of the values change then add them or take them away from a another cell in a different column Thankyou |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change shade of cells when selecting multiple cells | Excel Discussion (Misc queries) | |||
macro to change multiple values in a column | Excel Discussion (Misc queries) | |||
Sum cells in multiple worksheets which change every month | Excel Discussion (Misc queries) | |||
Can I change the names of multiple cells at once? | Excel Discussion (Misc queries) | |||
Change a Column list into multiple rows & columns | Excel Worksheet Functions |