Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Displaying Cell Formulas


--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Displaying Cell Formulas

I am assuming you want the formulas in you cells displayed without having to
double-click on them.

The following macro will copy the contents of the active sheet and paste
them as text on a new sheet:

Sub Formulas_to_text()
'
' Formulas_to_text Macro
' Macro written 9/9/2006 by ChristopherTri
'
' Macro copies the contents of the active sheet and pasts them onto a
' new sheet as text.
'

Dim test_formula() As Variant
new_column_width = 20 'Set width of
columns on new sheet

lastRow = ActiveSheet.UsedRange.Rows.Count 'find the last row
of the worksheet
lastColumn = ActiveSheet.UsedRange.Columns.Count 'find the last
column of the worksheet

ReDim test_formula(lastRow, lastColumn) As Variant 'Dimension array to
fit used range
'
' Copy formulas into array
'
For test_row = 1 To lastRow
For test_column = 1 To lastColumn
test_formula(test_row, test_column) =
ActiveSheet.Cells(test_row, test_column).Formula
Next test_column
Next test_row

Sheets.Add 'Add a new sheet
'
' Paste contents of array into new sheet as text
'
For test_row = 1 To lastRow
For test_column = 1 To lastColumn
ActiveSheet.Cells(test_row, test_column) = "'" &
test_formula(test_row, test_column)
Next test_column
Next test_row
'
' Format new sheet for better formula viewing
'
ActiveSheet.UsedRange.Select
With Selection
.ColumnWidth = new_column_width
.WrapText = True
End With

End Sub


After running the macro, you can either print or view as needed.




"Stranded" wrote:


--
Richard

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Displaying Cell Formulas

Go Tools / Options
Select the View tab
Under Windows options, select the Formulas checkbox

You may quickly change your mind about showing formulas, but this will do
the trick.

Ryan


"Stranded" wrote:


--
Richard

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel sees cell formulas as constants, will not solve Derek P Excel Worksheet Functions 1 July 28th 06 04:16 PM
Copying formulas from cell to cell to cell to....... Tom Hardy Excel Discussion (Misc queries) 3 June 15th 06 03:29 PM
change cell value greater than another cell value using formulas Unsure? Excel Worksheet Functions 2 April 2nd 06 10:24 PM
Cell references in formulas become text David E. Jones Excel Discussion (Misc queries) 3 November 4th 05 05:58 PM
Displaying in a cell the formula from another cell Arjan Excel Discussion (Misc queries) 1 July 21st 05 07:17 PM


All times are GMT +1. The time now is 11:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"