Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Modify Code Creating a Formula List

This is John Walkenbacks code to make a list of formulas on a worksheet. I would like to modify it as follows
1. Not show the rows where there is no formul
2. In the case where a formula links to another workbook, make all fonts red (three columns
3. Make the €śFormula€ť and €śValue€ť column widths = 4
4. Where columns are not wide enough to display all the text, make row height fit, and wrap

Could someone modify this code
Thanks
Phi

Sub ListFormulas(
'From John Walkenbac
'List formulas, cell addresses and values in a newly created workshee
Dim FormulaCells As Range, Cell As Rang
Dim FormulaSheet As Workshee
Dim Row As Intege

'Create a range object for all formula cell
On Error Resume Nex
Set FormulaCells = Range("A1").SpecialCells(xlFormulas, 23

'Exit if no formulas foun
If FormulaCells Is Nothing The
MsgBox "No Formulas, or the sheet is protected.
Exit Su
End I

'Add a new workshee
Application.ScreenUpdating = Fals
Set FormulaSheet = ActiveWorkbook.Worksheets.Ad
FormulaSheet.Name = "Formulas in " & FormulaCells.Parent.Nam

'Set up the column heading
With FormulaShee
Range("A1") = "Address
Range("B1") = "Formula
Range("C1") = "Value
Range("A1:C1").Font.Bold = Tru
End Wit

'Process each formul
Row =
For Each Cell In FormulaCell
Application.StatusBar = Format((Row - 1) / FormulaCells.Count, "0%"
With FormulaShee
Cells(Row, 1) = Cell.Address(RowAbsolute:=False, ColumnAbsolute:=False
Cells(Row, 2) = " " & Cell.Formul
Cells(Row, 3) = Cell.Valu
Row = Row +
End Wit
Next Cel

'Adjust column width
FormulaSheet.Columns("A:C").AutoFi
Application.StatusBar = Fals
End Su

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
Modify code bigmaas Excel Discussion (Misc queries) 2 February 16th 10 10:51 AM
modify a line code TUNGANA KURMA RAJU Excel Discussion (Misc queries) 6 June 3rd 08 12:31 PM
Modify Code Richard Excel Worksheet Functions 0 March 13th 08 08:19 PM
How to modify VBA code for Add-in? Shetty Excel Programming 1 March 3rd 04 04:04 PM
Modify Find Code Al[_6_] Excel Programming 1 July 15th 03 10:35 PM


All times are GMT +1. The time now is 08:45 AM.

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

About Us

"It's about Microsoft Excel"