Hi All
i was trying to write a macro so that user can get a input box and select any cell with date and hit OK then macro use that date in a formula and present the result in active cell. below is the code i tried, but it is giving error: #NAME?
Sub getweeknumber()
Dim originaldate As Date
originaldate = CDate(Application.InputBox("select the source", "Get Week Number"))
ActiveCell.Value = "=weeknum(originaldate,1)"
End Sub
any help will be much appreciated.
Bookmarks