Obrigado a todos que me ajudaram.
uma outra pessoa tambem me ajudou conforme a planilha abaixo
ajustei o codigo para que ela substitua a propria coluna A
Sub Replacement()
'
'
Dim Source1 As Worksheet
Dim Cell As Range
Set Source1 = Sheets("Plan1")
For Each Cell In Source1.Columns("A").Cells.SpecialCells(xlCellTypeConstants)
Cell.Offset(0, 1).Select
ActiveCell.Value = "=SEARCH("" "",RC[-1],1)"
Cell.Offset(0, 2).Select
ActiveCell.Value = "=LEFT(RC[-2],RC[-1]-1)"
Next Cell
Range("C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("C:C").Select
Selection.Delete
Range("A1").Select
X = Worksheets("Plan1").Range("B:B").Cells.SpecialCells(xlCellTypeConstants).Count
MsgBox "Foram substituídas " & X & " células.", vbInformation, "Resultados"
End Sub
http://www.4shared.com/file/X_ZbvUBu/Su ... ement.html
Créditos: Douglas Marcel
Postado : 20/02/2012 6:01 am