Texas Tech University



The material in this document is not necessary for the current assignment but is provided for those who want to know a little more about VBA. For help on creating functions you may wish to check the web. Here is one useful site: type and declaration: typeStorage sizeAllowable RangeBoolean 2 bytes True or False Integer 2 bytes -32,768 to 32,767 Long 4 bytes -2,147,483,648 to 2,147,483,647 Double 8 bytes -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values Currency 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807 Date 8 bytes January 1, 100 to December 31, 9999 String 10 bytes + string length Example function with double loop, array, and IF:Function JUMP(c, r, g, n)Dim j, k As IntegerDim A(10, 20) As Long'Double loop to initialize array A For k = 1 To n For j = 1 To n A(j, k) = j + 0.1 * k Next j Next k'End double loop'Bogus calculation for JUMP function:JUMP = c + r + g + n If r = g Then JUMP = c + n End If GoTo 2222 JUMP = JUMP + 1End Function ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download