concatenar datos automaticamente

dragonfire33

Board Regular
Joined
Oct 7, 2021
Messages
90
Office Version
  1. 365
Platform
  1. 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
 

Attachments

  • 23.png
    23.png
    161.8 KB · Views: 16

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,645
Latest member
Tante

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top