In myFunction, I want to create a log in a sheet with the arguments of the function and the time it was last executed.
My code is like this:
Function myFunction(arg1, arg2 As String)
//code here
Sheets("Sheet1").Range("A1") = arg1
Sheets("Sheet1").Range("B1") = arg2
Sheets("Sheet1").Range("C1") = datetime.Now
End Function
This function doesn't work with the last 3 lines (it does otherwise).
I also tried to create a separate module for this task:
Function myFunction(arg1, arg2 As String)
//code here
Call myLog(arg1,arg2)
End Function
But it doesn't work either
Public Sub myLog(arg1,arg2)
Sheets("Sheet1").Range("A1") = arg1
Sheets("Sheet1").Range("B1") = arg2
Sheets("Sheet1").Range("C1") = datetime.Now
End Sub
Thanks in advance for helping!