View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default display formulas as text

I have no "formula" solution as you requested, but here is a crude macro that
seems to do the job..........

Private Sub Worksheet_SelectionChange(ByVal target As Excel.Range)
'For target cell in column B
'If formula, place text version of formula in adjacent cell in column C
'If empty or contains text or number, leave adjacent cell alone
Dim f As String
If target.Cells.Column = 2 Then
If Not target.Formula = True Then
If target.Formula = target.Value Then
End
Else
target.Select
f = Selection.Formula
Selection.Offset(0, 1).Value = "'" & f
End If
Else
End If
End If
End Sub

hth
Vaya con Dios,
Chuck, CABGx3




"Will Fleenor" wrote:

Two good suggestions, thanks, but not what I was looking for. I would like
to have formulas in column B that are calculated in their normal manner.
Then in column C I would like to have a formula that would display the
forumla that is ine the corresponding cell in column B.

Example:
Contents of cell B1: =45*10
Display in B1: 450
Contents of cell C1:
Display in cell C1: =45*10

I need a formula in cell C1 because the contents of cell B1 can change and I
want the displayed formula in cell C1 to also change.

Thanks, Will


"CLR" wrote in message
...
Tools Options ViewTab check the FORMULAS box

Vaya con Dios,
Chuck, CABGx3



"Will Fleenor" wrote:

How to display (for documentation and debugging) in one column the
literal
textual representation of Excel formulas that are in another column?

OS: Windows XP all SPs and patches loaded.
AP: Excel 2003 all SPs and patches loaded.

Thanks, Will