NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 416
- Office Version
- 365
Hello all,
I made this function in VBA, but its not working. It gives me a "Application defined or object-defined error."
Changing TargetCell As String does not work either.
Any ideas what i'm doing wrong?
I made this function in VBA, but its not working. It gives me a "Application defined or object-defined error."
Code:
Sub Mysub()
Sheets("Parameters").Activate
TIMESTAMP (ActiveWorkbook.Sheets("Parameters").Range(B8).Value)
End
Private Function TIMESTAMP(TargetCell As Range)
TargetCell = Format(Now, "dd-mm-yy HH:mm:ss")
End Function
Changing TargetCell As String does not work either.
Any ideas what i'm doing wrong?