I am attempting to use VBA to capture the current time and store it in a variable. I have the syntax below, but I get a Compile Error of Object Required
Code:Dim addedDate As String: Set addedDate = DateValue(CStr(Now()))
I am attempting to use VBA to capture the current time and store it in a variable. I have the syntax below, but I get a Compile Error of Object Required
Code:Dim addedDate As String: Set addedDate = DateValue(CStr(Now()))
Remove the Set
Try
Dim addedDate As String: addedDate = DateValue(CStr(Now()))
though im not a fan of putting them on one line, and I think you've got too many functions in there, I might have:
Dim addedDate As String
addedDate = Date()
Set is for creating workspaces, not for formulae, equations, etc.