View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
TUNGANA KURMA RAJU
 
Posts: n/a
Default Printing formulas

Mr.Bob Philips,
Though I am late,I tested your code and really it is very good.I have one
query abouut this code.Am I to run this code twice?.When I first run this
code It has inserted "Formulas" sheet first.second time when I run this code
all formulas with address dumped into this formulas sheet.Is this two stepped
code?
secondly I am facing a problem with this code.While printing this "Formulas"
sheet many of my formulas have truncated,as they are very large(most of them
are more than 250 characters).Will you please modify that last line of your
code so that column B:B width b= 94 and all cells format in column B:B
=wraptext format =true.
and I would like to add column name"Address" for col A and "Formula" to
column B

"Bob Phillips" wrote:

You could just dump them all to a new worksheet and print that

Sub PrintFormulas()
Dim cell As Range
Dim sh As Worksheet
Dim i As Long

On Error Resume Next
Set sh = Worksheets("Formulas")
On Error GoTo 0
If sh Is Nothing Then
Set sh = Worksheets.Add
sh.Name = "Formulas"
Else
sh.Cells.ClearContents
End If
For Each cell In ActiveSheet.UsedRange
If cell.HasFormula Then
i = i + 1
sh.Cells(i, "A").Value = cell.Address(False, False)
sh.Cells(i, "B").Value = "'" & cell.Formula
End If
Next cell
sh.Activate
sh.Columns("B:B").AutoFit
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"TUNGANA KURMA RAJU" wrote in
message ...
I have 5 work sheets in a BOOK,each sheet a2:m30, every cell contains
formula.Iwould like to keep a hard copy of these formulas I have used.In
Toolsoptionsview tab I have checked formulas,but these formulas wrap

each
other by which I can't print these formulas.Is there any way to print all
these formulas at one go.