Boa tarde!!
Segue uma forma usando VBA.
Sub AleVBA_21995()
Dim lr As Long
Const sFormula1 As String = "=LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9,"" - ""},A2&""0123456789""))-1)"
Const sFormula2 As String = "=LOOKUP(99^99,--(""0""&MID(A2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&""0123456789"")),ROW($1:$10000))))"
Const sFormula3 As String = "=TRIM(LEFT(RIGHT(SUBSTITUTE("" - ""&A2,"" - "",REPT("" "",999)),2*999),999))"
Const sFormula4 As String = "=TRIM(RIGHT(RIGHT(SUBSTITUTE("" - ""&A2,"" - "",REPT("" "",99)),297),99))"
With Sheets("Plan1")
lr = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Range("B2").Resize(lr).Formula = sFormula1
.Range("C2").Resize(lr).Formula = sFormula2
.Range("D2").Resize(lr).Formula = sFormula3
.Range("E2").Resize(lr).Formula = sFormula4
.Range("B2").Resize(lr, 4).Value = .Range("B2").Resize(lr, 4).Value
End With
End Sub
Att
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 27/09/2016 9:49 am