Update corresponding Cell if another cell changes data

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,259
Office Version
  1. 2010
Platform
  1. Windows
HI i hope you can help i need a formula to update a cell if changes are made, my range is A2:R18 , ROWS B2:R2 have dates in and columns A3:A18 have areas in, then B3:R18 have numbers in.

In Cell AC3 and AC4 this is a lookup for the date and area where it crossreferences and find the number in the corresing cell and put this number into Cell AC5. In AC6 this is where the number can be updated. What i want is then this to update the corresding cell from A2:R18. what formula could i use please to do this?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If I have understood correctly what you have, you won't be able to use a formula anywhere in B2:R18 to update from cell AC6.
Instead, you could try this Worksheet_Change event code in a copy of your workbook. To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

I have assumed that
- AC3 contains a date matching one of the dates in B2:R2 and
- AC4 contains an area matching one of the areas in A3:A18 and
- AC6 is entered manually

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim rDate As Range, rArea As Range
  
  If Not Intersect(Target, Range("AC6")) Is Nothing Then
    Set rDate = Range("B2:R2").Find(What:=Range("AC3").Value)
    Set rArea = Range("A3:A18").Find(What:=Range("AC4").Value)
    Application.EnableEvents = False
    Cells(rArea.Row, rDate.Column).Value = Range("AC6").Value
    Application.EnableEvents = True
  End If
End Sub
 
Upvote 0
HI would this work in multiple workbooks that are shared and will be open?
 
Upvote 0
HI would this work in multiple workbooks that are shared and will be open?
It will only work on worksheets where you have inserted the code as described in steps 1 & 2 of my previous post.
 
Upvote 0
ok thank you, so if i put the code into 3 workbooks which are saved in different folders, and they were all open at the same time and updated, would they still work if linked together?
 
Upvote 0
ok thank you, so if i put the code into 3 workbooks which are saved in different folders, and they were all open at the same time and updated, would they still work if linked together?
I don't know what you mean by "linked together" but the easiest way to answer that for sure would be to try it. :)
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,670
Members
452,993
Latest member
FDARYABEE

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top