Find and Replace error
To add a space at left of selected cells thus showing formulas.
Sub Add_Space()
Dim R As Range
Dim thisrng As Range
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address)
For Each R In thisrng
R.Formula = " " & R.Formula
Next
End Sub
To remove the spaces.
Sub trim_spaces()
Dim R As Range
For Each R In Selection
If Not R.HasFormula Then
a = R.Address
R.Value = Evaluate("Trim(" & a & ")")
End If
Next
End Sub
Gord Dibben MS Excel MVP
On Sun, 30 May 2010 10:11:01 -0700, Emece
wrote:
Hi.
I have a worksheet where I want to show only some of the formulas used in
it. That is why, instead of using the option "Show formulas" from the
formulas Tab, I insert a ' before the = in the cells I want to see the
formula.
But when I want to show results once again, in order no to look for each
formula in which I added the ', I use the Find and Replace Option. In Find I
specify '= and leave in blank the Replace option. But Excel shows me the
following message: "Excel cannot find the data you are searching for".
Cannot figure out the correct way of doing it...
Thanks in advance for your help
Regards,
Emece.-
|