Printing Formulae

P

pikapika13

I haven't tested it, but try "CNTRL + ~" then print.
The squigly thing is on the top left
 
R

RagDyer

<Tools> <Options> <View> tab,
Put a check in "Formulas" and then <OK>.

All formulas are now displayed, where you can now simply print the sheet.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

How do I get Excel to print formulae instead of values ?
 
F

foolio

Thats exactly what i was looking for rag ... i remember a way of doin
it at school just couldnt remember how to do it
 
G

Gord Dibben

foolio

Hit CRTL + `(backquote above TAB key) to view formulas and print if you wish.

I find this rather messy and prefer to use John Walkenbach's code to place
formulas, addresses and results on a separate sheet for printing.

If not sure what to do with the code below, post back for more assistance or
see David McRitchie's Getting Started with Macros.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sub ListFormulas()
'from John Walkenbach
Dim FormulaCells As Range, cell As Range
Dim FormulaSheet As Worksheet
Dim Row As Integer
Dim ws As Worksheet
' Create a Range object for all formula cells
On Error Resume Next
Set FormulaCells = Range("A1").SpecialCells(xlFormulas, 23)

' Exit if no formulas are found
If FormulaCells Is Nothing Then
MsgBox "No Formulas."
Exit Sub
End If

' Add a new worksheet
Application.ScreenUpdating = False
Set FormulaSheet = ActiveWorkbook.Worksheets.Add
FormulaSheet.Name = "Formulas in " & FormulaCells.Parent.Name

' Set up the column headings
With FormulaSheet
Range("A1") = "Address"
Range("B1") = "Formula"
Range("C1") = "Value"
Range("A1:C1").Font.Bold = True
End With

' Process each formula
Row = 2
For Each cell In FormulaCells
Application.StatusBar = Format((Row - 1) / FormulaCells.Count, "0%")
With FormulaSheet
Cells(Row, 1) = cell.Address _
(RowAbsolute:=False, ColumnAbsolute:=False)
Cells(Row, 2) = " " & cell.Formula
Cells(Row, 3) = cell.Value
Row = Row + 1
End With
Next cell

' Adjust column widths
FormulaSheet.Columns("A:C").Cells.WrapText = True ''AutoFit
Application.StatusBar = False
End Sub

Gord Dibben Excel MVP
 
M

macropod

Hi,

The following macro adds the formulae to the comments for each selected
cell, or even the whole worksheet, and displays the comments in an
appropriately-sized box.

Sub AddFormulasToComments()
Application.ScreenUpdating = False
Dim CommentRange As Range, TargetCell As Range
'skip over errors caused by trying to delete comments in cells with no
comments
On Error Resume Next
'If the whole worksheet is selected, limit action to the used range.
If Selection.Address = Cells.Address Then
Set CommentRange = Range(ActiveSheet.UsedRange.Address)
Else
Set CommentRange = Range(Selection.Address)
End If
'If the cell contains a formula, turn it into a comment.
For Each TargetCell In CommentRange
With TargetCell
'check whether the cell has a formula
If Left(.Formula, 1) = "=" Then
'delete any existing comment
.Comment.Delete
'add a new comment
.AddComment
'copy the formula into the comment box
.Comment.Text Text:=.Formula
'display the comment
.Comment.Visible = True
With .Comment.Shape
'automatically resizes the comment
.TextFrame.AutoSize = True
'position the comment adjacent to its cell
If TargetCell.Column < 254 Then.IncrementLeft -11.25
If TargetCell.Row <> 1 Then .IncrementTop 8.25
End With
End If
End With
Next
MsgBox " To print the comments, choose" & vbCrLf & " File|Page
Setup|Sheet|Comments," & vbCrLf & "then choose the required print option.",
vbOKOnly
Application.ScreenUpdating = True
End Sub

By default, worksheet comments don't print. To print the comments, choose
File|Page Setup|Sheet|Comments, then choose the required print option.
 
Top