+ Reply to Thread
Results 1 to 5 of 5

Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

Hybrid View

Jhon Mustofa Transpose Every Row From... 09-26-2020, 09:43 AM
Mumps1 Re: Transpose Every Row From... 09-26-2020, 01:16 PM
Mumps1 Re: Transpose Every Row From... 09-26-2020, 01:51 PM
Jhon Mustofa Re: Transpose Every Row From... 09-26-2020, 07:48 PM
Mumps1 Re: Transpose Every Row From... 09-27-2020, 08:31 AM
  1. #1
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

    hi expert..
    the following problem, i would hope someone would help me out to solve this problem:
    i have a workbook that contains several sheet with random name sheet. For each sheet have the same format but different data.
    i want to transpose every 22 or n rows from multiple sheet and multiple column to one sheet into multiple columns. Then my data contains merge cell and i want keep it. The following cell below that i want to transpose 12 cells with criteria like this:
    start from transpose cell C3,C4,C5,C7,C8,C11,C12,E9,E11,E12,C15 and C21 (sheet "lap-1)
    start from transpose cell C25,C26,C27,C29,C30,C33,C34,E31,E33,E34,C37 and C43 (sheet "lap-1)
    etc...
    with interval row is 22 row and repeated occurring for the other sheet

    how to transpose to other sheet e.g. "sheet "destination" or other sheet name.
    for easy i highlighted color cell.
    here attachment file

    any help, greatly appreciated
    john m
    Attached Files Attached Files
    Last edited by Jhon Mustofa; 09-26-2020 at 09:52 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

    Before trying the macro below, you will have to unmerge all the cells containing "Nama Bangunan Air" in column A of all the worksheets. You should avoid using merged cells at all cost because they almost always give macros problems. Also start with a blank "destination" sheet.
    Sub TransposeData()
        Application.ScreenUpdating = False
        Dim LastRow As Long, desWS As Worksheet, ws As Worksheet, fnd As Range, sAddr As String, Col As Long
        Set desWS = Sheets("destination")
        For Each ws In Sheets
            If ws.Name <> "destination" Then
                LastRow = desWS.Range("B" & desWS.Rows.Count).End(xlUp).Row
                Set fnd = ws.Range("A:A").Find("Nama Bangunan Air", LookIn:=xlValues, lookat:=xlWhole)
                If Not fnd Is Nothing Then
                    sAddr = fnd.Address
                    Do
                        With desWS
                            Col = .Cells(LastRow + 1, Columns.Count).End(xlToLeft).Offset(0, 1).Column
                            .Cells(LastRow + 1, Col).End(xlUp).Offset(1).Resize(, 12).Value _
                                = Array(fnd.Offset(, 2), fnd.Offset(2, 2), fnd.Offset(3, 2), fnd.Offset(5, 2), fnd.Offset(6, 2), fnd.Offset(8, 2), fnd.Offset(9, 2) _
                                , fnd.Offset(6, 4), fnd.Offset(8, 4), fnd.Offset(9, 4), fnd.Offset(12, 2), fnd.Offset(18, 2))
                        End With
                        Set fnd = ws.Range("A:A").FindNext(fnd)
                    Loop While fnd.Address <> sAddr
                    sAddr = ""
                End If
            End If
        Next ws
        Application.ScreenUpdating = True
    End Sub
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

    This should work without unmerging the cells.
    Sub TransposeData()
        Application.ScreenUpdating = False
        Dim LastRow As Long, desWS As Worksheet, ws As Worksheet, fnd As Range, sAddr As String, Col As Long
        Set desWS = Sheets("destination")
        For Each ws In Sheets
            If ws.Name <> "destination" Then
                LastRow = desWS.Range("B" & desWS.Rows.Count).End(xlUp).Row
                Set fnd = ws.Range("A:B").Find("Nama Bangunan Air", LookIn:=xlValues, lookat:=xlWhole)
                If Not fnd Is Nothing Then
                    sAddr = fnd.Address
                    Do
                        With desWS
                            Col = .Cells(LastRow + 1, Columns.Count).End(xlToLeft).Offset(0, 1).Column
                            .Cells(LastRow + 1, Col).End(xlUp).Offset(1).Resize(, 12).Value _
                                = Array(fnd.Offset(, 1), fnd.Offset(2, 1), fnd.Offset(3, 1), fnd.Offset(5, 1), fnd.Offset(6, 1), fnd.Offset(8, 1), fnd.Offset(9, 1) _
                                , fnd.Offset(6, 3), fnd.Offset(8, 3), fnd.Offset(9, 3), fnd.Offset(12, 1), fnd.Offset(18, 1))
                        End With
                        Set fnd = ws.Range("A:B").FindNext(fnd)
                    Loop While fnd.Address <> sAddr
                    sAddr = ""
                End If
            End If
        Next ws
        Application.ScreenUpdating = True
    End Sub

  4. #4
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

    hi Mumps1....thank yo so much.
    Working well!!!!

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Transpose Every Row From Multiple Sheet Into To One Sheet Into Multiple Column

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Multiple sheets data update in Summary sheet by transpose mode
    By shyampanda in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2020, 02:14 AM
  2. [SOLVED] Find and Replace Multiple Columns in Sheet 1 Based on a Column Values in Sheet 2
    By adblog3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-07-2020, 01:49 PM
  3. Transpose rows from multiple sheets into new sheet
    By Watson17 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-16-2019, 11:59 AM
  4. [SOLVED] Transpose specific row of multiple sheets into one single sheet using VBA
    By haer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2016, 11:17 PM
  5. [SOLVED] How to transpose multiple columns and multiple rows in a sheet to another sheet
    By manojuasc in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-28-2015, 05:59 PM
  6. [SOLVED] Copy column and transpose to row - Multiple worksheets to summary sheet.
    By nique in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-22-2014, 09:50 PM
  7. Transpose multiple rows to columns sheet attached
    By ahad_bwp in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 08:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1