Sub colE()
Dim rngstr As String
Dim Estr As String
rngstr = ActiveSheet.UsedRange.AddressLocal
rngstr = Mid(rngstr, InStr(1, rngstr, ":") + 1)
rngstr = Mid(rngstr, InStr(1, rngstr, "$") + 1)
rngstr = Mid(rngstr, InStr(1, rngstr, "$") + 1)
MsgBox rngstr
Estr = "E1:E" & rngstr
Range(Estr).Select
For Each cell In Selection
cell.Activate
If cell.Value <> "" Then
If Len(CStr(cell.Value)) = 1 Then cell.Value = 2000 + cell.Value
If cell.Value = 10 Then cell.Value = 2000 + cell.Value
If Len(CStr(cell.Value)) = 2 Then cell.Value = 1900 + cell.Value
End If
Next
End Sub
|