I think the "horse" is still alive and doing well.
To answer your question, yes those apostrophes were the results of a
formula being converted to values?
I have been doing some futher investigation.
It is easy for me to reproduce this problem.
I am using excel 2002 and start with a new blank Sheet.
With Tools/Options/Transition/Transition navigation keys unchecked
All cells are formatted under Number tab with General category.
I type into cell A1 the text "test"
into cell B1 the formula =IF(A1="x",A1,"")
into cell C1 =ISBLANK(B1)
and into D1 =CODE(B1)
Now after pressing the enter key in B1 the cell appears" blank" but contains
the result of the formula.
Next selecting B1 right click COPY and without moving to another cell
location
right click again and do a Paste/Special/Values.
With B1 still selected
I get a blank looking cell B1 but with ' in the formula bar.
Had I pasted/special/values in another location there would be no
problem:the formula bar and cell would both be blank.
Hope you can reproduce this.
Dave Peterson said:
Just to keep kicking this dead horse...
Are you sure that those apostrophes were the results of a formula being
converted to values?
I ran this and found a difference between typing the apostrophe and converting
to values:
Option Explicit
Sub testme()
With Workbooks.Add(1).Worksheets(1).Range("a1")
.Clear
Debug.Print "after clear: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Value = "'"
Debug.Print "after apostrophe: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Clear
.Formula = "="""""
Debug.Print "with formula: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Value = .Value
Debug.Print "after value = value: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
Debug.Print "----Typing in apostrophe manually--------------"
.Clear
Debug.Print "after clear: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Value = "'"
.Replace what:="", replacement:="$$$$$"
Debug.Print "after first replace: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Replace what:="$$$$$", replacement:=""
Debug.Print "after second replace: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
Debug.Print "----using a formula--------------"
.Clear
Debug.Print "after clear: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Formula = "="""""
.Value = .Value
.Replace what:="", replacement:="$$$$$"
Debug.Print "after first replace: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Replace what:="$$$$$", replacement:=""
Debug.Print "after second replace: *" _
& .PrefixCharacter & "*-- = " & Len(.PrefixCharacter)
.Parent.Parent.Close savechanges:=False
End With
End Sub
And got these results:
after clear: **-- = 0
after apostrophe: *'*-- = 1
with formula: **-- = 0
after value = value: **-- = 0
----Typing in apostrophe manually--------------
after clear: **-- = 0
after first replace: *'*-- = 1
after second replace: *'*-- = 1
----using a formula--------------
after clear: **-- = 0
after first replace: **-- = 0
after second replace: **-- = 0