Data from rows into columns
Closed
cheryl
-
Oct 14, 2011 at 04:56 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 17, 2011 at 06:09 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 17, 2011 at 06:09 AM
Related:
- Data from rows into columns
- Display two columns in data validation list but return only one - Guide
- Tmobile data check - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Gta 5 data download for pc - Download - Action and adventure
- Digital data transmission - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Oct 15, 2011 at 07:40 AM
Oct 15, 2011 at 07:40 AM
how one can identify that what cells belong together?
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Oct 17, 2011 at 06:09 AM
Oct 17, 2011 at 06:09 AM
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
Oct 15, 2011 at 11:48 AM
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?
Oct 16, 2011 at 11:18 PM