Transposing group of cells in column to rows

DaleKeel

Board Regular
Joined
Sep 11, 2019
Messages
56
Office Version
  1. 2013
Platform
  1. Windows
I copy the following from a web page that was 4 column of rows. I pasted it in excel and showed up in one column.

9/26/2019 11:15
BTC
0.03142971
Completed

9/19/2019 12:01
BTC
0.02388444
Completed

9/10/2019 20:46
RVN
2414.582
Completed

There are more than 100 of these groups in one column. I tried to create a macro to transpose them all but I do not know how to make it repeat until all groups are transposed.
The following is what I did. Please help. Thanks

' Macro2 Macro
'

'
Range("D6:D9").Select
Selection.Copy
Range("F6").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("D11:D14").Select
Application.CutCopyMode = False
Selection.Copy
Range("F11").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("D16:D19").Select
Application.CutCopyMode = False
Selection.Copy
Range("F16").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I found answer. I first deleted the blank rows then

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Option Explicit

Public Sub TransposeX5()

Const DoColumn As Integer = 1 ' transpose column A into columns B-E
Const StartRow As Integer = 1 ' start at row 1

Dim iLastRow As Long
Dim iRow As Long
Dim iOffset As Integer

iLastRow = Cells(Rows.Count, DoColumn).End(xlUp).Row

For iRow = StartRow To iLastRow Step 4
For iOffset = 1 To 4
Cells(iRow, DoColumn + iOffset) = Cells(iRow + iOffset - 1, DoColumn)
Next iOffset
Next iRow

End Sub[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif][/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif][/FONT]

THANKS
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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