Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel -Show Formula  - Cell Format Wrap?

Posted on 2011-03-21
4
Medium Priority
?
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 24

Accepted Solution

by:
Tracy earned 2000 total points
ID: 35181771
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
ID: 35181890
You can add apostrophe ' at the beginning of the formula:

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

Expert Comment

by:wchh
ID: 35185510
You can also change the formula cells to TEXT format...
0
 

Author Closing Comment

by:AndyPandy
ID: 35198179
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

636 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