Easiest to do with 2 grids. The first contains the data in a known unit of measurement, the 2nd contains the converted values.
But it can be done with 1 grid, the only complication is that everything must be converted back to a default measurement system before converting again to the desired system.
For example - Add some numbers to G5:I7 (Totally arbitrary, it's just what I highlighted). To help validate the results make these simple units (1, 2, 3...), Add a Data Validation list to F3, I used 'Inches,Feet,Yards, MM, CM, M'. Inches are my 'standard', the factors below will have to change if that changes.
Add the following code to the worksheet code module
It's not the best code, but illustrates the idea. Also it may introduce rounding errors but I don't think you'll need that sort of precision. You can always format the cells with as many decimal places as needed as remove the Rounding in the code. Also, you cannot edit the values unless the 'standard' unit of measurement is selected.
If you decide to use 2 grids then it's a simple matter of looping through the 'static' grid calculating the new values in the second using whatever factor for the selection. No need for 2 passes.
Bookmarks