New to VBA,
can you use a function result as an argument for another function? If not, what would be the best way to do it? The following code shoud illustrate the problem: I generate data with function f_1 and want to pass the data to function f_2.
Function f_1(Arg_11, Arg_12)
For i = 1 To 100
Cells(i, 1).Value = Arg_11 * Arg_12
Next i
End Function
Function f_2(Arg_21, Arg_22)
For j = 1 To 100
Cells(j, 1).Value Arg_21 + Arg_22
Next j
End Function
Sub test()
k = 20
m = 10
g = 1
Debug.Print (f_1(k, m))
Debug.Print (f_2(g, f_1))
End Sub
f_2(g, f_1))supposed to mean? Whatever it is that you are trying to do, it wouldn't be achieved by passing one function to another, though it might be achieved by passing the return value of one function to another.