Not quite sure why you want to do this, as it might be better to change the calculation options (tools, options, calculation - change to manual, and only recalculate when you want to!). Or in VBA:Originally Posted by jiura
[vba]
'to go in workbook
Private Sub Workbook_Open()
Dim wWorksheet As Worksheet
For Each wWorksheet In Worksheets
With wWorksheet
.EnableCalculation = False
End With
Next wWorksheet
Application.OnKey "{F9}", "Calculatatator"
End Sub
[/vba]
And this in a new module
[vba]
Private Sub Calculatatator()
MsgBox ("Calculated!")
For Each wWorksheet In Worksheets
With wWorksheet
.EnableCalculation = True
.EnableCalculation = False
End With
Next wWorksheet
MsgBox ("'")
End Sub
[/vba]
Alternatively, if you are set on changing them to text, instead just add the ' character (apostrophe) at the start of the line in a cell.
'=1+2
will display as
=1+2
in the cell, and not
3
Make sense?
So all you need to do is something like
[vba]
this is pseudo code, untested, unlooked at
dim wk as worksheet
dim
for each wk in ActiveWorkbook
for each cell in wk
Cell.Value = text("'" & cell.value)
' (this is ", then ', then ")
next cell
next wk
'though I think that this will take forever and a day, as it's going to look at EVERY cell :P
[/vba]
Although ' is the character for commenting, since it's in quote marks it knows what you mean :P