Copying Cells and Transposing them using VBA

zaska

Well-known Member
Joined
Oct 24, 2010
Messages
1,046
Hi ,

I am experimenting with following data in two Columns A and B

Name Kate
Age 24
Place NewJersey
Phone000000
Pin 1234
Status Yes
Name Mate
Age 25
Place NewBull
Phone000000
Pin 1235
Status Yes
Name Late
Age 29
Place NewMercey
Phone000000
Pin 1238
Status Yes

I wish to tranpose this data into 6 Columns ( A,B,C,D,E,F) and sort them.

Kindly help me

Thankyou
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
This should be a start

Code:
Sub test()
Dim LR As Long, i As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
Range("A1:A6").Copy
Range("C1").PasteSpecial Paste:=xlPasteValues, Transpose:=True
For i = 1 To LR Step 6
    Range("B" & i).Resize(6).Copy
    Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
Next i
Columns("A:B").Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,226,727
Messages
6,192,688
Members
453,747
Latest member
tylerhyatt04

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