Solved

Excel -Show Formula  - Cell Format Wrap?

Posted on 2011-03-21
4
342 Views
Last Modified: 2012-05-11
Hi Experts,

How to Cell format wrap a formula?
I have tried everthing I know,   seems formula does not want to be wrapped.
I want to wrap so that I can print on one sheet. formulas are not wrapping, what gives?
0
Comment
Question by:AndyPandy
4 Comments
 
LVL 24

Accepted Solution

by:
broomee9 earned 500 total points
Comment Utility
You'd have to make them text for the wrap function to work.  Have a look at this link:

http://www.excelbanter.com/showthread.php?t=188426

Below is the code from the link, to convert to text and then wrap it for printing.
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
With FormulaSheet.Columns("A:C")
.Cells.WrapText = True
End With
Application.StatusBar = False
End Sub

Open in new window

0
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
You can add apostrophe ' at the beginning of the formula:

'=DATEDIF('Employee Data...
0
 
LVL 8

Expert Comment

by:wchh
Comment Utility
You can also change the formula cells to TEXT format...
0
 

Author Closing Comment

by:AndyPandy
Comment Utility
Thank you for this great solution!
The other suggestions for creating text fields are good for a couple cells, are OK but this was was fanatastic for pages of formulas!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now