Showing posts with label excel function. Show all posts
Showing posts with label excel function. Show all posts

Friday, January 11, 2008

Excel VBA commands

In this post, I will simply list a bunch of useful single (approximately) line VBA for Excel commands.

'Minimize the Excel Application.
'This does not work when a userform is open.
Application.WindowState = xlMinimized


'Get the active cell column as a number
Dim dblCurrentColumn As Double
dblCurrentColumn = Application.ActiveCell.Column


'Get the active cell row as a number
Dim dblCurrentRow As Double
dblCurrentRow = Application.ActiveCell.Column


'Declare an array. This example declares a 6 x 3 array.
Dim vntArray(0 To 5, 0 To 2) As Variant


'The general form is to declare an N x M array as:
Dim vntArray(0 To N-1, 0 to M-1).

Tuesday, November 13, 2007

Beta Distribution Random Number Generator

I have posted on the right, a link to buy code for a Beta Distribution Random Number Generator. The purchase price is $1. This function can be used to produce random variables according to the beta distribution, with user-specified parameters. The beta distribution is a very useful bell-shaped (but not Gaussian) distribution that is bounded (ie the tails do not go from -inf to +inf) and can be scaled to any range of values. I will soon produce code that will allow the user to specify the function that he or she wants to use to produce random variables.