Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a function from a subroutine loop
Here is a subroutine and function that I cannot work out or find help on.
I'm trying to call a function in a subrouting, and then have the function calculated inside a loop for changing variable values. Any advice would be appreciated. Dan Public Function CR(Y, X, Z) Y = X^Z End Function Sub CalcCR() Call CR(Y, X, Z) X = 2 Z = 3 alpha = 1 For i = 1 to 10 X = X + Y Next i End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a function from a subroutine loop
Public Function CR(Y, X, Z)
Y = X^Z CR = Y End Function Sub CalcCR() X = 2 Z = 3 alpha = 1 For i = 1 to 10 results = CR(Y, X, Z) msgbox "X=" & X & " Results: " & results X = X + Y Next i End Sub -- Regards, Tom Ogilvy "Dan" wrote in message ... Here is a subroutine and function that I cannot work out or find help on. I'm trying to call a function in a subrouting, and then have the function calculated inside a loop for changing variable values. Any advice would be appreciated. Dan Public Function CR(Y, X, Z) Y = X^Z End Function Sub CalcCR() Call CR(Y, X, Z) X = 2 Z = 3 alpha = 1 For i = 1 to 10 X = X + Y Next i End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calling a subroutine outside a spreadsheet | Excel Programming | |||
Function Calling Subroutine | Excel Programming | |||
calling a macro from within a loop | Excel Programming | |||
calling a macro from within a loop | Excel Programming | |||
Calling the Solver via a subroutine | Excel Programming |