Veja teste na coluna B, se é o que espera (Macro/VBA no evento change da planilha)
Private Sub Worksheet_Change(ByVal Target As Range)
'By Reinaldo
Target.Select
Application.ScreenUpdating = False
If Not Intersect(Target, Range("B1:B100")) Is Nothing And Len(Target.Value) > 11 Then
Selection.NumberFormat = "@"
Target.Value = Format(WorksheetFunction.Substitute(WorksheetFunction.Substitute(Target.Value, ".", "", 1), "-", "", 1), "00000000000")
End If
Application.ScreenUpdating = True
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 11/12/2012 11:11 am