View Single Post
  #13   Report Post  
Dave Peterson
 
Posts: n/a
Default

You can create a new workbook full of your functions. Lots of people put these
kinds of functions into their personal.xl* workbook.

But if you're going to share these utilities with others, you won't want to use
the name personal.xl*.

Use a name like: DeernadUtils.xls or DeernadUtils.xla

If you save this workbook as a .xls file, make sure you have that workbook open
and you can use:

=deernadutils.xls!eval(a1)
in any other open workbook.

If you save it as an addin (*.xla), you can then turn that addin on.

Tools|addins|browse|point at your addin workbook.
Then you can use:
=eval(a1)

If only have functions like this, I like the addin approach. You can stick a
copy out on a network drive and tell your co-workers to install it just like you
did.

==
No matter what you choose, if you don't save the workbook/addin with others,
then make sure you convert these formulas to values (edit|copy, edit|paste
special|values).

Deernad Construction wrote:

Thank you very much for your help. It solved my problem. Is there any way
to make this formula available to use on all excel documents without having
to go through the whole Module setup over and over? For instance, making it
like the SUM function where you just type it into the formula bar?

Thanks again for your help already given!

"Dave Peterson" wrote:

There's nothing built into excel that lets you do that.

But you could create a user defined function that did it.

Option Explicit
Function Eval(myStr As String) As Variant
Eval = Application.Evaluate(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.

Then use a formula like:

=eval(A24)
if A24 contained the string to evaluate.



Deernad Construction wrote:

I am using Office 2000. I have an aritmetic problem that I want to display
in one cell and then have it total those numbers in a seperate cell. I need
it to be able to automatically change the total in cell A2 if I change a
number in cell A1 I can't figure out how.
Example of how I'd like it displayed:
[Cell A1] 1+2.5+3+4
[Cell A2] 10.5


--

Dave Peterson


--

Dave Peterson