I've got a spreadsheet where I enter some amount in one currency and it's converted automatically into another using a web linked exchange rate in the formula. I then want to lock the results converting the formula into value by checking a checkbox in the same row. So I need to link the cells I nee to lock to each checkbox nd then assign a macro, which will convert the formulas in the linked cells into values when the checkbox is checked.
So I am going to use a macro something like this to convert the formulas into values
Where I need to defined rng as cells linked to a particular checkbox.
1. How can I linked cells to checkbox and assign a macro automatically? The checkboxes are at the end of each row so I can just linked all cells in the row before a checkbox.
2. How can I define rng as linked cells to a particular checkbox?
Thaks a lot!
So I am going to use a macro something like this to convert the formulas into values
VBA Code:
Sub LockValues()
Option Explicit
Dim rng As Range
For Each rng In Selection
If rng.HasFormula Then
rng.Formula = rng.Value
End If
Next rng
End Sub
Where I need to defined rng as cells linked to a particular checkbox.
1. How can I linked cells to checkbox and assign a macro automatically? The checkboxes are at the end of each row so I can just linked all cells in the row before a checkbox.
2. How can I define rng as linked cells to a particular checkbox?
Thaks a lot!