Hi All,
need some help.
we have a bunch of books that are listed in Col A. Colb will be simple in and out selected from a dropdown.
I am using a little code to set a date in Col C depending on what is selected in Col B. If the book is "in" then the date in Col C is cleared, if the book is out, Col C will show the date it left. This works fine
now to my problem.
I would like to find the oldest date in Col C. Problem here is that there are blank cells and my code always returns the wrong date.
Ultimately I would like the lowest date copied to cell H2 and the ref. to which one it is into cell H4 (row number)
I only have 2 hair left and woul dlike to keep them. Any takers?
need some help.
we have a bunch of books that are listed in Col A. Colb will be simple in and out selected from a dropdown.
I am using a little code to set a date in Col C depending on what is selected in Col B. If the book is "in" then the date in Col C is cleared, if the book is out, Col C will show the date it left. This works fine
Code:
trg = Target.Address
Vab = ActiveSheet.Range(trg).Value
If Vab = "Out" Then
ActiveCell.Offset(0, 1) = Format(Now(), "mm.dd.yyyy")
Else
ActiveCell.Offset(0, 1).Value = ""
End If
now to my problem.
I would like to find the oldest date in Col C. Problem here is that there are blank cells and my code always returns the wrong date.
Code:
Dim lRow As Long
lRow = Cells(Rows.Count, 2).End(xlUp).Row
LowDate = Format(WorksheetFunction.Min(Range("C2:C" & lRow)), "mm.dd.yyyy")
Debug.Print Format(LowDate, "mm.dd.yyyy")
Cells.Find(What:=Range(LowDate), After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Ultimately I would like the lowest date copied to cell H2 and the ref. to which one it is into cell H4 (row number)
I only have 2 hair left and woul dlike to keep them. Any takers?