Talvaez assim:
Sub separar()
Dim uLin As Integer, X As Integer, j As Integer
uLin = Sheets("Base Original").Cells(Cells.Rows.Count, 1).End(xlUp).Row
Range("A2:A" & uLin).Select
Selection.TextToColumns Destination:=Range("M2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", TrailingMinusNumbers:=True
Dim lCol As Integer
lCol = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
X = 0
For i = 2 To uLin
For j = 13 To lCol
If Cells(i, j + 1) <> "" Then
Rows(i + 1 & ":" & i + 1).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
X = X + 1
End If
Next
j = 13
For t = 0 To X
Cells(i + t, 1) = Cells(i, j + t)
Cells(i + t, 2) = Cells(i, 2)
Next
i = i + X: uLin = uLin + X
X = 0
Next
Columns("M:R").Select
Selection.Clear
Range("A1").Select
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 02/11/2012 11:49 am