Solved

Excel -Show Formula  - Cell Format Wrap?

Posted on 2011-03-21
4
385 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:
broomee9 earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

705 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