Most Excel spreadsheets contain formulas. Sometimes you may want to force only the result of a formula to occupy a cell, instead of leaving the formula in place, where it will change if/when the data it references changes.
You can do this manually in a couple of ways, or you can use a macro that will make the job a breeze. Let's look at the manual methods first.
You can copy the formula
results and still leave the original formulas in place using
Excel's Paste
Special tool.
Assume you have formulas residing in cells A1:A100. Select
this range, select Copy, and then select the starting cell for the
mirror results. Select Edit
If you want to override the original formulas with their results,
select the formula range and select Copy.
With the formula range still selected, select Edit
You also can copy formula results and still leave the original formulas in place by using a pop-up menu that many users don't even know exists.
Select the formula range and right-click the right or left border of the selection (in other words, anywhere in the selection except for the fill handle). While holding down the right mouse button (or Ctrl-clicking on a Macintosh), drag to the destination, release the right mouse button, and click "Copy Here as Values Only" from the resulting pop-up shortcut menu.
You also can override the original formulas with their results. Select the formula range, then right-click the right or left border of the selection (again, anywhere in the selection except for the fill handle). While pressing the right mouse button (or Ctrl-clicking), drag over one column to the right or left and then back to the starting range, release the right mouse button, and click "Copy Here as Values Only" from the resulting pop-up shortcut, shown in Figure 2-23.
If you frequently convert cells containing formulas and functions to their values, you can use this simple macro:
Sub ValuesOnly( ) Dim rRange As Range On Error Resume Next Set rRange = Application.InputBox(Prompt:="Select the formulas", _ Title:="VALUES ONLY", Type:=8) If rRange Is Nothing Then Exit Sub rRange = rRange.Value End Sub
To
use this macro, select Tools