Convert XX to 20XX text date in VBA
<p>I have cells with this format:
1/feb/12
And I format cells as date xx/xx/xxxx like this:</p>

<pre><code>Columns("A:A").Select
Selection.Replace What:="-", Replacement:="/", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
Selection.NumberFormat = "m/d/yyyy"
</code></pre>

<p>But when I execute it, Excel shows a warning: "Text date with 2 digit year" and shows me some options, I want the one that says "Convert XX to 20XX text date in VBA". This happens because the year is 12 and it asks if it is 1912 or 2012.
I want my vba macro to say "it is 2012".</p>

<p>Some way?? If I do the same "replace" manually (not on vba) the 2012 is automatically updated, but I need this automatic.</p>

<p>Thanks.</p>

<p>EDIT:</p>

<p>Finally solved with this:</p>

<pre><code> 'Pasa los años XX a 20XX
Private Sub FormatAny()
Dim i As Integer
i = 1
For Each celda In Range(Range("A1"), Cells(ActiveSheet.Rows.Count, 1))
    If Len(celda.Text) &gt; 4 Then
        Dim divTexto: divTexto = Split(celda.Text, "/")
        If UBound(divTexto) - LBound(divTexto) = 2 Then
            If Len(divTexto(UBound(divTexto))) = 2 Then
                divTexto(UBound(divTexto)) = "20" &amp; divTexto(UBound(divTexto))
                celda = Join(divTexto, "/")
                Range("A" &amp; i).Select
                ActiveCell.FormulaR1C1 = celda
            End If
        End If
    End If
i = i + 1
If (i = 32676) Then
    Exit For
End If
Next
End Sub
</code></pre>