Hi Guys !
I would like to build a function in a macro that will find me the date, e.g. 2020.08, using inputbox and mark the yearly range. I mean, if I want 2020.08, I would like it to mark the range from that date to 2019.08. on below a is a suggestion , going to good way ? After that i would like updated a chart
I would like to build a function in a macro that will find me the date, e.g. 2020.08, using inputbox and mark the yearly range. I mean, if I want 2020.08, I would like it to mark the range from that date to 2019.08. on below a is a suggestion , going to good way ? After that i would like updated a chart
Rich (BB code):
Do
inputbx = InputBox("Enter Date, FORMAT; YYYY-MM-DD", Format(VBA.Now, "YYYY-MM-DD"))
If inputbx = vbNullString Then Exit Function
On Error Resume Next
vDate = DateValue(inputbx)
On Error GoTo 0
DateIsValid = IsDate(vDate)
If Not DateIsValid Then MsgBox "Please enter a valid date.", vbExclamation
Loop Until DateIsValid
wb.Worksheets("Final").Activate
With wb.Worksheets("Final")
Set loc = .Cells.Find(what:=vDate)
If Not loc Is Nothing Then
lc = .Cells(loc.Row, Columns.Count) - 12/CODE]