 
|
Custom Excel Functions
|
|
 

|
 |
You can write custom functions in Excel. This is a brief, rough
introduction to doing so. I assume you already know some programming language.
Excel macros and custom functions are written in Visual Basic, which is actually really
nice for scripting junk like this. As long as you have done some programming its
structure should seem obvious.
Start by firing up the Visual Basic editor:
Step by Step instructions.
Next, write the simplest possible function: a "Hello World" function.
Step by Step instructions.
Finally, write a non-trivial function: one that does least squares fitting for data
with uncertainty in one or both variables.
Step by Step instructions.
Or, cut to the chase and just download the code I wrote, embedded in a pretty excel
spreadsheet or as an add-in.
Source Code for Least Squares fitting in Excel.
I also made the routines into an add-in -- a special spreadsheet which contains VB code
only; by placing it in the Office/XLStart directory, it will automagically load with Excel
and be ready for use any time.
Read this document from Micro$oft which explains how to make an add-in.
There! Now you know everything that I do about programming in Excel Visual Basic.
Have fun!
Disclaimer: I really don't know anything, beyond the above,
about Excel programming or Visual Basic!
If you have questions about these topics do not send them to me.
It will only stress me out. I have a thesis to write. Instead, go look at http://www.allexperts.com/software/excel.shtml
or http://www.faqs.org/faqs/spreadsheets/faq/.
On the other hand, I can talk all day about least squares fitting with error
in both variables. Go ahead and ask, especially if you are an instructor of another
course.
|
|
 |
 |
 |
 |
 |
 |
 |
|
 |
Data Analysis Using Excel
and Mathematica |

|
|
|
|
You can write custom functions in Excel. This is a brief, rough introduction to doing
so. I assume you already know some programming language. Excel macros and
custom functions are written in Visual Basic, which is actually really nice for scripting
junk like this. As long as you have done some programming its structure should seem
obvious.
Start by firing up the Visual Basic editor:
Step by Step instructions.
Next, write the simplest possible function: a "Hello World" function.
Step by Step instructions.
Finally, write a non-trivial function: one that does least squares fitting for data
with uncertainty in one or both variables.
Step by Step instructions.
Or, cut to the chase and just download the code I wrote, embedded in a pretty excel
spreadsheet or as an add-in.
Source Code for Least Squares fitting in Excel.
I also made the routines into an add-in -- a special spreadsheet which contains VB code
only; by placing it in the Office/XLStart directory, it will automagically load with Excel
and be ready for use any time.
Read this document from Micro$oft which explains how to make an add-in.
There! Now you know everything that I do about programming in Excel Visual Basic.
Have fun!
Disclaimer: I really don't know anything, beyond the above,
about Excel programming or Visual Basic!
If you have questions about these topics do not send them to me.
It will only stress me out. I have a thesis to write. Instead, go look at http://www.allexperts.com/software/excel.shtml
or http://www.faqs.org/faqs/spreadsheets/faq/.
On the other hand, I can talk all day about least squares fitting with error
in both variables. Go ahead and ask, especially if you are an instructor of another
course.
|