martinctc
12/11/2012 - 5:01 PM

Find and Replace values in column with array values - Excel

Find and Replace values in column with array values - Excel

Sub Macro1()

findArray = Array("/01/", "/02/", "/03/", "/04/", "/05/", "/06/", "/07/", "/08/", "/09/", "/10/", "/11/", "/12/")
replArray = Array("/Jan/", "/Feb/", "/Mar/", "/Apr/", "/May/", "/Jun/", "/Jul/", "/Aug/", "/Sep/", "/Oct/", "/Nov/", "/Dec/")

For i = 0 To UBound(findArray)
    Selection.EntireColumn.Select
    Selection.Replace What:=findArray(i), Replacement:=replArray(i), LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False


Next i
End Sub