Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I found this function through a Google search hoping to help me convert a text date (May 6, 2020) to a number that Excel can use.
With my example in cell A1 of my worksheet, the result I get when I enter (into another cell on the worksheet) =GetDate1(A1) is #VALUE!
Now I don't doubt it's an effective function, but I don't think I'm using it correctly. Unsure the purpose of the $ in the forumal. I suspect it needs to be tweaked somehow to recognize my value.
Suggestions?
Code:
Public Function GetDate1(ByVal rng As Range)
GetDate = CDate(Left$(rng.Text, InStr(InStr(rng.Text, ", ") + 1, rng.Text, ", ") - 1))
End Function
With my example in cell A1 of my worksheet, the result I get when I enter (into another cell on the worksheet) =GetDate1(A1) is #VALUE!
Now I don't doubt it's an effective function, but I don't think I'm using it correctly. Unsure the purpose of the $ in the forumal. I suspect it needs to be tweaked somehow to recognize my value.
Suggestions?