Data from rows into columns
Closed
cheryl
-
14 Oct 2011 à 04:56
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 17 Oct 2011 à 06:09
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 17 Oct 2011 à 06:09
Related:
- Data from rows into columns
- How to copy data from one excel sheet to another - Guide
- Tmobile data check - Guide
- How to delete rows and columns in word - Guide
- Export data from excel - Guide
- Excel move data from one sheet to another - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
15 Oct 2011 à 07:40
15 Oct 2011 à 07:40
how one can identify that what cells belong together?
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
17 Oct 2011 à 06:09
17 Oct 2011 à 06:09
try this. Correct the sheet name, column etc in the code
Public Sub copyNRowsToColumns()
Dim sSrcSheet As String
Dim lSrcRowStart As Long
Dim iSrcCol As Integer
Dim sTgtSheet As String
Dim lTgtRowStart As Long
Dim iTgtCol As Integer
Dim lRowsToTranspose As Long
Dim lSrcRow As Long
Dim lTgtRow As Long
Dim lLastSrcRow As Long
sSrcSheet = "Sheet1"
lSrcRowStart = 1
iSrcCol = 1
sTgtSheet = "Sheet1"
lTgtRowStart = 1
iTgtCol = 2
lRowsToTranspose = 4
With Sheets(sSrcSheet)
lLastSrcRow = .Cells(.Rows.Count, iSrcCol).End(xlUp).Row
For lSrcRow = lSrcRowStart To lLastSrcRow Step lRowsToTranspose
.Range(.Cells(lSrcRow, iSrcCol), .Cells(lSrcRow + lRowsToTranspose - 1, iSrcCol)).Copy
Sheets(sTgtSheet).Cells(lTgtRowStart, iTgtCol).PasteSpecial Transpose:=True
lTgtRowStart = lTgtRowStart + 1
Next lSrcRow
End With
End Sub
15 Oct 2011 à 11:48
Thanks for picking this up and apology for being so confusing here...the first 4 data/rows is in Column A in this format as mentioned below
ABC
France
20
FXG
And I want a formula where I can pull up all the four rows in one cell in te following format "ABC France 20 FXG" hope this make sense?
16 Oct 2011 à 23:18