What is wrong with this code? It's not working.
I want to extract date only, from column T in this format 08/26/2020. The date usually appears at the beginning of a bunch of text.
I want to extract date only, from column T in this format 08/26/2020. The date usually appears at the beginning of a bunch of text.
VBA Code:
or kk = 1 To Len(fullstr)
digt = Mid(A1, Find("/", A1, 1) - 2, 10)
If IsNumeric(digt) And startstr < 0 Then ' check for the first number in the string
startstr = kk ' set this to start of the string
End If
digasc = Asc(digt) ' convert the current character to ascii
If startstr > 0 And (digasc > 57 Or digasc < 47) Then ' this checks whether the digit is a number or /
endstr = kk ' set then end of the string as the first character which isn't a number or a slash
Exit For
End If
Next kk
If startstr > 0 Then
dt = Mid(fullstr, startstr, endstr - startstr + 1)
mastarr(i, 7) = dt