Forum Discussion

DerekHart's avatar
DerekHart
Copper Contributor
Sep 07, 2020
Solved

Is_Date Help!

I want an excel cell to properly detect there is a date in the cell. And then return the date to the cell. I cannot get this reliably working. Sometimes it works, but if I start with a text field in ...
  • Ramiz_Assaf's avatar
    Sep 09, 2020

    DerekHart 

     

    Try to do the If in VBA, then forcing the formatting you need

     

    Function IF_IS_DATE(rng As Range) As String
    If IsDate(rng) = True Then
    IF_IS_DATE = Format(rng, "Long Date")
    Else
    IF_IS_DATE = Application.WorksheetFunction.Trim(rng)
    End If
    End Function

     

Resources