Jim
I incorrectly assumed all the data to be changed would be text and left
numbers and formulas as was. Try the code below with xlTextValues removed.
Sub Add_Text_Left()
Dim cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo Endit
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants)
moretext = InputBox("Enter your Text")
For Each cell In thisrng
cell.Value = moretext & cell.Value & moretext
Next
Exit Sub
Endit:
MsgBox "only formulas in range"
End Sub
Note: if any formulas reference the changed data you will get errors(#VALUE)
If you also want any formula results to also have the quotes change also:
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants)
to: Set thisrng = Range(ActiveCell.Address & "," & Selection.Address)
Gord
Thanks Gord for the help. It worked great for 90% of
the entries but I have dates, positive and negative numbers
in some cells that didn't get the quotes.
Is there a way around this?
Thanks,
Jim