Lock current calculated cell values in single row with toggle.

FirewalkerZ5

New Member
Joined
May 14, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Using office 365.
Cell B3 has a dropdown with "Proposed" and Approved". Column "B" has calculations from another sheet, Data validation, calculated formulas and user data input.
Problem, When Cell B3 is changed from "Proposed" to "Approved" I would like to lock the current values into Column "B" and prevent them from changing.
One thing I have done is included an "IF" function on the other sheet that says if Cell C8 has a value, use that value, if not place this calculation into Cell B8. The issue I have is that when I put a value into cell C8 it duplicates the value into B8 because of where the value comes from. I need this to also be able to be turned off if put back to "Proposed".

I did find something similar in this video but not exactly what I am looking for.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Ok, I finally figured out how to upload the data.
This is the code I have come up with so far. (Not working properly)

Sub Approved()
MsgBox "Approved"
For Each cell In Range("B4:B36")
If Left(cell.Formula, 1) = "=" Then
NewFormula = "=" & cell.Formula & "+N(""" & cell.Formula & """)"
cell.Formula = NewFormula
cell.Interior.Color = 777777
End If
Next cell
End Sub
Sub Proposed()
MsgBox "This isnt working right"
For Each cell In Range("B4:B36")
OldFormula = cell.Formula
WhereFound = InStr(1, OldFormula, "+N(")
If WhereFound > 0 Then
StartAt = WhereFound + 4
EndAt = Len(OldFormula) - 2
LenghtToGet = EndAt - StartAt + 1
NewFormula = Mid(OldFormula, StartAt, LengthToGet)
cell.Formula = OldFormula
cell.Interior.Color = 16777215

End If
Next cell
End Sub

Code will capture values if I change "Formula" to "Value" but will not remove new formula or value and replace with old.

Practice Workbook 10 yr.xlsm
B
3Proposed
43.50%
5350
6
7Amount
8$64,890.00
9$29,505.06
10$0.00
11$0.00
12$1,200.00
13$423.00
14$654.00
15$96,672.06
16
17$97,763.00
18$0.00
19$0.00
20$0.00
21$0.00
22$0.00
23$0.00
24$0.00
25$0.00
26$0.00
27$0.00
28$0.00
29$0.00
30
31
32
33$97,763.00
34$3,421.71
35-$1,090.94
36
Current Year Budget
Cell Formulas
RangeFormula
B8:B9B8='Projected Revenue and Expenses'!B9
B10:B11,B18:B29B10=0+N("0")
B15B15=SUM(B8:B14)
B17,B33B17=97763+N("97763")
B34B34=3421.705+N("3421.705")
B35B35=B15-B33
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B7:C11,B15:C15,B33:C36,B17:C29Cell Value<0textNO
Cells with Data Validation
CellAllowCriteria
B3ListProposed,Approved
B12Custom=IF($B$30,"")
B13Custom=IF(B31,"")
B14Custom=IF(B32,"")
B30Custom=IF($B$12,"")
B31Custom=IF(B13,"")
B32Custom=IF(B14,"")
 
Upvote 0

Forum statistics

Threads
1,215,091
Messages
6,123,062
Members
449,089
Latest member
ikke

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