2011-06-08 00:22:06 UTC
FY10 TECH-CON as of 30 November 2010.xlsx
FY11 TECH-CON as of 25 April 2011 for review.xlsx
To accomplish this I have been studying/ experimenting with an excellent VBA macro written by Yahoo Answers contributor garbo7441’s response to a similar question (Garbo’s code is included below). It uses the Find ”/” thingy to extract the date (- 2 characters from “/” forward 10). For instance the macro works perfect if the text string in column A1 were instead: FY10 TECH-CON as of 30/11/2010.xlsx, but not when in the dd MMMM yyyy format. I have tried making it find the “.” which is unique in each row, but as far as I can tell there is no way to account for the value difference (May = 3 characters, September=9).
Any suggestions/help on making this work are greatly appreciated!
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i, LastRow
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LastRow
If Cells(i, "A").Value <> "" Then
dmark = Application.Find("/", Cells(i, "A"), 1)
If Len(Cells(i, "A")) < 12 Then
Cells(i, "B").Value = Cells(i, "A").Value
Else
Cells(i, "B").Value = Format(Mid(Cells(i, "A"), _
dmark - 2, 10), "mm/dd/yyyy")
End If
End If
Next
End Sub