I have a date in cell B7 in my worksheet that is formated as 9/1/2019, I want to convert it to a text string in the format YYYY-MM-DD or 2019-09-01. I tried using WorksheetFunction.Text and searched the web for examples, but my code just generated a "True" result instead of a reformatted date.
Dim FormattingValue As String
Dim FormattingResult As String
FormattingValue = WS1.Range("B7").Select
FormattingResult = WorksheetFunction.Text(FormattingValue, "YYYY-MM-DD")
Debug.Print FormattingResult
The Debug.Print returns the value "True" and not a date in the YYYY-MM-DD format.