On 2002-09-13 06:37, aabbasi wrote:
Is there a way to display Formula's instead of Result on Excel Sheet. I want to use this function to train people how the calculation is performed on a particular sheet. I have about 20 different formulas used on this sheet.
Any help will be appreciated!
Thank you
I believe the shortcut to show formulas is
Ctrl+`. This may change the formatting on your sheet.
I use UDF (User Defined Function) GF (short for GetFormula)
Function GF(Rng As Range) As String
GF = Rng.Formula
End Function
Example =gf(A2) shows =Today()
or to document cells (including arrays)
formula is in A1
in another cell type A1
If the following UDF is in your file and it is assigned the shortcut Ctrl_Shift_F.
Using the function will format A1 and show
the complete formula that is in A1.
Sub FormulaDocumentation()
'
' Macro recorded 22/12/2001 by D.G. Patton
'
Dim Address1 As String
ActiveCell = UCase(ActiveCell)
Address1 = ActiveCell.Value
Selection.HorizontalAlignment = xlRight
If VarType(ActiveCell) = 0 Then
MsgBox "Did you select the cell with the formula's address?"
ElseIf Range(Address1).HasArray Then
ActiveCell.Offset(0, 1) = "{" & Range(Address1).Formula & "}"
ElseIf VarType(Address1) = 8 Then
ActiveCell.Offset(0, 1) = "'" & Range(Address1).Formula
Else
ActiveCell.Offset(0, 1) = Range(Address1).Formula
End If
End Sub
Assign to Ctrl-Shift-F