|
|
|
|
|
|
Excel
|
Show Formula as Text
|
|
Ease of Use
|
Intermediate
|
Version tested with
|
2002
|
Submitted by:
|
Zack Barresse
|
Description:
|
This is a User-Defined Function (UDF) that will show the formula of a cell as text. If no formula, it will show the cell value.
|
Discussion:
|
Providing a summary of your spreadsheet and want to show your formula(s) as text? This UDF will do just that. So if you type in A1 "=1+1" you will see "2" in that cell. With this if you type "=FTEXT(A1)" you will see "=1+1"
|
Code:
|
instructions for use
|
Function FTEXT(f As Range)
If f.HasFormula Then
FTEXT = f.Formula
Else: FTEXT = f
End If
End Function
|
How to use:
|
- Copy code.
- Open workbook to copy code to.
- In Excel, press Alt + F11 to open the VIsual Basic Editor (VBE).
- Click the Insert menu.
- Click Module.
- Paste code in right window.
- Press Alt + Q to close the VBE.
|
Test the code:
|
- In a blank cell type =FTEXT(A1), change A1 to desired cell.
|
Sample File:
|
FTEXT.zip 5.34KB
|
Approved by mdmackillop
|
This entry has been viewed 208 times.
|
|