[need vba] transpose data to multiple column into one column

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi guys..

could you help me, how to figure out this problem using vba code (transpose multiple column into one column):

sample data (in col.a)
COL.ABCDE
ACTIVEPT BANKJOHN MAC OBAMA2014.12.00025MEDAN STREET # 10
ACTIVEPT AGUNGLEE DONALD2014.12.00965SAHANA STREET 8
etc..

<tbody>
</tbody>

after macro :

col.G
ACTIVE
PT BANK
JOHN MAC OBAMA
2014.12.00025
MEDAN STREET # 10
(BLANK ROW/SPACE)
PT AGUNG
LEE DONALD
2014.12.00965
SAHANA STREET 8
etc...

<tbody>
</tbody>

any assistance, will be appreciated...

m.susanto
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
hi may be this help you

before macro

Sheet1

*ABCDE
1ACTIVEPT BANKJOHN MAC OBAMA2014.12.00025MEDAN STREET # 10
2ACTIVEPT AGUNGLEE DONALD2014.12.00965SAHANA STREET 8

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:51px;"><col style="width:71px;"><col style="width:126px;"><col style="width:93px;"><col style="width:129px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4




after macro

Sheet1

*ABCDEFG
1ACTIVEPT BANKJOHN MAC OBAMA2014.12.00025MEDAN STREET # 10*ACTIVE
2ACTIVEPT AGUNGLEE DONALD2014.12.00965SAHANA STREET 8*PT BANK
3******JOHN MAC OBAMA
4******2014.12.00025
5******MEDAN STREET # 10
6*******
7******ACTIVE
8******PT AGUNG
9******LEE DONALD
10******2014.12.00965
11******SAHANA STREET 8

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:51px;"><col style="width:71px;"><col style="width:126px;"><col style="width:93px;"><col style="width:129px;"><col style="width:64px;"><col style="width:129px;"></colgroup><tbody>
</tbody>








Excel tables to the web >> Excel Jeanie HTML 4





Code:
Option Explicit
Sub Multiple_Col_To_One()
Dim lr As Integer
Dim i As Integer
Dim j As Integer
j = 2
lr = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To lr
    Range(Cells(i, 1), Cells(i, 5)).Copy
    Cells(Rows.Count, 7).End(xlUp).Offset(2 - j, 0).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=True
    j = 0
Next
Cells(1, 7).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,655
Members
448,975
Latest member
sweeberry

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