When cell with formula changes -> edit adjacent cell

Dani_LobP

Board Regular
Joined
Aug 16, 2019
Messages
134
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I want to know if its possible the below scenario:

I have a table, with some formulas here and there, but in column O, I have a formula with some conditions and dependent on other 3 columns in same table.
What I want to know, is, if I can have some kind of script that every time formula in O is refreshed and the result changes, to have in column P a Yes, and if nothing changed, leave it with No (as per default).

So basically I want to just have a Yes in P column, when the formula in O result changed (because other columns values were edited, making O formula bring different result).
O column cell formula starts in O6 , same as P columns, is P6 if that helps.

I tried to check around but some answers can't really fully understand.

By the way, is this a potential reason to make file slow? and, if formulas are set to manual, will macro only work once refresh happens?

thanks in advance!
 
Comment out the Exit For line
VBA Code:
        If arr(i, 1) <> arrTemp(i, 1) Then
            Sheets("BSS Template").ListObjects("MainData").ListColumns("BSS input").DataBodyRange.Cells(i).Offset(, 1) = "YES"
            Exit For    ' to not check any further
        End If
Oh ok, i actually saw that, but wasnt sure what it meant. So that comment prevented it from checking the whole table line by line?
without comment, will just check all the way down ?
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Comment out the Exit For line
VBA Code:
        If arr(i, 1) <> arrTemp(i, 1) Then
            Sheets("BSS Template").ListObjects("MainData").ListColumns("BSS input").DataBodyRange.Cells(i).Offset(, 1) = "YES"
            Exit For    ' to not check any further
        End If
edit:
thanks!
so by commenting it out, will be checking the whole table from top to bottom vs checking until 1 YES happened, right? seems to work now after testing a bit.
somehow makes the file slow when formulas are set to automatic, so will have to keep them manual and refresh every now and then.

thanks again for your help!
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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