LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Dana DeLouis
 
Posts: n/a
Default Question On Excel Formulas

Hi. Don't know if you would be interested in this idea:
If I select your equation, and run this macro (via button for me), then I
display a message like the one below.
This only works for simple equations like yours. Doesn't work well for more
complicated equations.
I personally like to make them cell notes. Maybe this will give you some
ideas for your own:

Sub Equation_Values()
Dim v As Variant
Dim itm As Variant
Dim Fx As String
Dim s As String

Fx = ActiveCell.Formula
s = Fx & vbLf

On Error Resume Next
Set v = ActiveCell.Precedents
If Err.Number 0 Then Exit Sub

For Each itm In v
Fx = Replace(Fx, itm.Address(True, True), itm.Value)
Fx = Replace(Fx, itm.Address(True, False), itm.Value)
Fx = Replace(Fx, itm.Address(False, True), itm.Value)
Fx = Replace(Fx, itm.Address(False, False), itm.Value)
Next itm
s = s & vbLf & Fx & vbLf

For Each itm In v
s = s & vbLf & itm.Address(False, False) & ": " & itm.Value
Next itm

'// Usa a Message Box
' MsgBox s

'// Or make it a Comment
Err.Clear
ActiveCell.AddComment s
If Err.Number 0 Then ActiveCell.Comment.Text s
ActiveCell.Comment.Shape.TextFrame.AutoSize = True
End Sub


Displays:
= = = = = = =
=A1+B1+C1/D1

=5+2+3/4

A1: 5
B1: 2
C1: 3
D1: 4
= = = = = = =



--
Dana DeLouis
Win XP & Office 2003


"David Smith" wrote in message
...
Hello,

Is there a way (addin utilities or otherwise) to cause the formula in a
cell to display the values for the component references making up the
formula?

-i.e =A1 *(B2+C4)/D2

would display based on the cell reference values as:

=5*(4+6)/8

Thanks for your help,

David S





 
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
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Delete the formulas of webpage, copied & pasted on excel sheet Mustafa Abedin Excel Discussion (Misc queries) 1 June 19th 05 02:39 PM
Provide a way to turn off auto-checking excel formulas as I type t ikarius_rb Excel Discussion (Misc queries) 6 March 23rd 05 12:33 PM
How Excel & ACCPAC 6.1 calculate formulas???? Bass Mama1 Excel Worksheet Functions 1 February 9th 05 03:25 PM
Excel Formulas albebach Excel Discussion (Misc queries) 1 February 2nd 05 09:52 PM


All times are GMT +1. The time now is 06:04 PM.

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"