Bom dia!!
Talvez isso ajude.
Sub test_AleVBA()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("A2", Range("A" & Rows.Count).End(xlUp))
Call concatenar_celulas(cell.Offset(, 4), cell.Resize(, 4)) 'Destination column A, Source B:F
Next cell
Application.ScreenUpdating = True
End Sub
Sub concatenar_celulas(cell As Range, source As Range)
Dim c As Range
Dim i As Integer
i = 1
With cell
.Value = vbNullString
.ClearFormats
For Each c In source
If Len(c.Value) Then .Value = .Value & "/" & Trim(c)
Next c
.Value = Trim(Mid(.Value, 2))
For Each c In source
With .Characters(Start:=i, Length:=Len(Trim(c))).Font
.Name = c.Font.Name
.FontStyle = c.Font.FontStyle
.Size = c.Font.Size
.Strikethrough = c.Font.Strikethrough
.Superscript = c.Font.Superscript
.Subscript = c.Font.Subscript
.OutlineFont = c.Font.OutlineFont
.Shadow = c.Font.Shadow
.Underline = c.Font.Underline
.ColorIndex = c.Font.ColorIndex
End With
.Characters(Start:=i + Len(c) + 1, Length:=1).Font.Size = 1
i = i + Len(Trim(c)) + 1
Next c
End With
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 01/02/2013 7:51 am