Help converting column data to rows

jimbobimbo

New Member
Joined
Oct 14, 2004
Messages
2
I have some data imported from a text file in a single column that I would like to convert to rows. The "Transpose" function works but I'm having difficulty putting it in a macro that will do this for me.

The data is as follows - 10 cells then a space:

# 1
1 CREATE POINT 213CP01_1:210IQI1560.OUT
1 PUT POINT 213CP01_1:210IQI1560.OUT TYPE FLOAT
DESC = ""210FE102 APRN FDR MTR"""
AUDITUPD = NO
COLLECTOR = hs4401
COLMETH = CONNECTED
ENGUNITS = %
EXPORT = NO
FASTFREQ = 5"

# 2
1 CREATE POINT 215CP01_1:210IQI1631.OUT
1 PUT POINT 215CP01_1:210IQI1631.OUT TYPE FLOAT
DESC = ""210CV102 DRIVE MTR TOTAL""
AUDITUPD = NO
COLLECTOR = hs4401
COLMETH = CONNECTED
ENGUNITS = %
EXPORT = NO
FASTFREQ = 5

Thanks in advance
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this:
Code:
Sub Transpose()
Range(Range("A1"), Range("A1").Offset(ActiveSheet.UsedRange.Rows.Count, 0)).Copy
Range("C1").PasteSpecial Transpose:=True
End Sub
 
Upvote 0
One way:

Sub Test1()
With Application
.ScreenUpdating = False
Dim i As Long, LR As Long
LR = Cells(Rows.Count, 1).End(xlUp).row
i = 1
Do
Range(Cells(i, 2), Cells(i, 12)).Value = .Transpose(Range(Cells(i, 1), Cells(i + 10, 1)))
i = i + 11
Loop While i <= LR
Columns(1).Delete
Columns(1).SpecialCells(4).EntireRow.Delete
Range("A1").CurrentRegion.Columns.AutoFit
.Goto Range("A1"), True
.ScreenUpdating = True
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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