View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Is it possible to change and entire worksheet to text?

Select all the cells with values and run this macro

Sub ChangeAllToText()
Dim myC As Range
For Each myC In Selection
myC.Value = "'" & myC.Text
Next myC
End Sub

The line
Cells.Value = CStr(Cells.Value)
won't work because you will lose the formatting - .Text shows the formatted
value, and you need to loop through to put the ' in front of the values,
(especially date values) to keep them from converting back from text.

HTH,
Bernie
MS Excel MVP



"Carrie_Loos via OfficeKB.com" <u34134@uwe wrote in message
news:848e1685f696f@uwe...
Hmmmmmm - That sounds interesting, I'll give it a try and let you know.

JLGWhiz wrote:
I have never tried it, but it seems like Cells.Value = CStr(Cells.Value)
should work.

Thanks Norman -

[quoted text clipped - 32 lines]
Thanks
Carrie


--
Message posted via http://www.officekb.com