Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Macro for displaying formula

Hi,

Any code appreciated...I want to be able to run a dynamic function that
would display the formula as text beside a cell that contains a formula...not
every formula , but only those I run the function on it..

for example, in cell B20 if there is a formula =sum(B1:B19)...that displays
the total of those cells above it... ...then just beside it in cell C20 if I
type a function like = formula display (b20)...it would display =sum(B1:B19)
and if I insert 5 or so more rows up top with 5 additional value cells in
them, which would change the result in cell B24, the function in C25 would
change automatically as well to display the new formula as text (such as
=sum(B2:B24)
thank you!!!

Craig
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Macro for displaying formula

Instead, how about Ctrl + ~
--
Jim Cone
Portland, Oregon USA



"Craig"
wrote in message
Hi,
Any code appreciated...I want to be able to run a dynamic function that
would display the formula as text beside a cell that contains a formula...not
every formula , but only those I run the function on it..

for example, in cell B20 if there is a formula =sum(B1:B19)...that displays
the total of those cells above it... ...then just beside it in cell C20 if I
type a function like = formula display (b20)...it would display =sum(B1:B19)
and if I insert 5 or so more rows up top with 5 additional value cells in
them, which would change the result in cell B24, the function in C25 would
change automatically as well to display the new formula as text (such as
=sum(B2:B24)
thank you!!!
Craig
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Macro for displaying formula

Hi Craig

In a standard module (not sheet module):

Public Function CellFormula(Rng As Range) As String
CellFormula = Rng(1).Address(False, False, Application.ReferenceStyle) _
& " formula: " & Rng(1).FormulaLocal
End Function

In a worksheet:

=CellFormula(A1)

HTH. Best wishes Harald

"Craig" wrote in message
...
Hi,

Any code appreciated...I want to be able to run a dynamic function that
would display the formula as text beside a cell that contains a
formula...not
every formula , but only those I run the function on it..

for example, in cell B20 if there is a formula =sum(B1:B19)...that
displays
the total of those cells above it... ...then just beside it in cell C20 if
I
type a function like = formula display (b20)...it would display
=sum(B1:B19)
and if I insert 5 or so more rows up top with 5 additional value cells in
them, which would change the result in cell B24, the function in C25 would
change automatically as well to display the new formula as text (such as
=sum(B2:B24)
thank you!!!

Craig


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Macro for displaying formula

Another option would be to place the formulas in the Cell Comments
using vba...

With Range("B20")

.ClearComments
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Range("B20").Formula
.Comment.Shape.TextFrame.AutoSize = True

End With
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
displaying formula bar TJG Setting up and Configuration of Excel 2 February 13th 10 03:08 PM
Displaying a Picture with a Macro JB Bates[_2_] Excel Discussion (Misc queries) 1 November 2nd 09 10:48 PM
Same formula but ?value displaying Cheese_whiz Excel Discussion (Misc queries) 4 March 19th 08 12:42 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Help::how to run macro without displaying workbooks.. No Name Excel Programming 4 January 4th 04 09:20 PM


All times are GMT +1. The time now is 08:48 PM.

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"