dragonfire33
Board Regular
- Joined
- Oct 7, 2021
- Messages
- 90
- Office Version
- 365
- Platform
- Windows
buenas como puedo mejorar este codigo para concatenear datos y enviarlos a la parte derecha como se muestra en la imagen
VBA Code:
Sub Columnas()
On Error Resume Next
Application.ScreenUpdating = False
Range([AZ1].End(xlToLeft), [A1]).SpecialCells(xlCellTypeBlanks).EntireColumn.Delete
F = [A1].CurrentRegion.Rows.Count
G = [A1].CurrentRegion.Columns.Count
For J = 1 To G
For i = 1 To F
For x = 1 To Len(Cells(i, J))
Y = Y & Mid(Cells(i, J), x, 1) & " "
Next x
Cells(i, J + 200) = Trim(Y): Y = "":
Next
Columns("AA:>N").Delete Shift:=xlToRight
Next
Range([AA1].End(xlToRight).Offset(0, -1), [AA1]).EntireColumn.Delete
FF = [A1].CurrentRegion.Rows.Count
GG = [A1].CurrentRegion.Columns.Count * 4
For Z = 0 To GG - 4 Step 4
Range(Cells(FF, Z + 27), Cells(2, Z + 27)).Borders.Item(xlEdgeLeft).LineStyle = xlContinuous
Range(Cells(FF, Z + 27), Cells(2, Z + 27)).TextToColumns Destination:=Cells(2, Z + 27), DataType:=xlDelimited, ConsecutiveDelimiter:=True, Other:=True, OtherChar:=" "
Next
With [AA1:CZ1]: .ColumnWidth = 3: .HorizontalAlignment = xlLeft: End With
Application.ScreenUpdating = True
End Sub