M
Michiel via OfficeKB.com
Anyone who can shine a light on this?
1) Worksheet functions can be called in VBA by using: Application.
WorksheetFunctionName
2) The worksheet function 'WeekNum' Exists
3) It works fine in my worksheet '=WEEKNUM(NOW(),1)'
Based on these I would say this would also work:
Sub WeekDay()
Dim dt As Date
dt = Now()
MsgBox Application.Weeknum(dt, 1)
End Sub
However I get: "Object doesn't support this property or method" (err#438)
I also know the Weeknum can be directly called from VBA by installing the Add-
In. But I just want to use the worksheet function.
Anyone?
1) Worksheet functions can be called in VBA by using: Application.
WorksheetFunctionName
2) The worksheet function 'WeekNum' Exists
3) It works fine in my worksheet '=WEEKNUM(NOW(),1)'
Based on these I would say this would also work:
Sub WeekDay()
Dim dt As Date
dt = Now()
MsgBox Application.Weeknum(dt, 1)
End Sub
However I get: "Object doesn't support this property or method" (err#438)
I also know the Weeknum can be directly called from VBA by installing the Add-
In. But I just want to use the worksheet function.
Anyone?