Monday, June 9, 2008

Macro for Arithmetic function Formula

Macro for Arithmetic function Formula
Session I Part 1.

In This Session, I will show you how to create a unit of code for Arithmetic function. A Function is a unit of code enclosed either between the Function and End Function statements.

Now, you can create a macro with one module. Fill it with the following Function
1. Create four following Function
Function kali(addr As Integer, addr2 As Integer) As String
kali = addr * addr2
End Function
Function bagi(addr As Integer, addr2 As Integer) As String
bagi = addr / addr2
End Function
Function tbh(addr As Integer, addr2 As Integer) As String
tbh = addr + addr2
End Function
Function krg(addr As Integer, addr2 As Integer) As String
krg = addr - addr2
End Function

Macro secI part1

2. Function number 1 and 2 is Multiplication and Division function, you can see result for Multiplication and Division function on range "E" and sampel formula on range "F"




3. Function number 3 and 4 is Addition and Subtraction function, you can see result for Multiplication and Division function on range "E" and sampel formula on range "F"



OK guys, This is very simple macro. Next time I will show you how to create more complex function.

1 comments:

Anonymous said...

it's so simple, please more complex script