+ Reply to Thread
Results 1 to 4 of 4

Data transpose (from vertical input to Horizontal output)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Data transpose (from vertical input to Horizontal output)

    Dear all, after long day , once again , need macro to data transpose from horizontal input to vertical output.
    before data
    Keisuke Hi
    1 ruum · 1 guiter · TKD 90
    3-38-5-301 Hazawa, Nerima-ward, TOKYO, 176-0003, Japan
    +819038031597 · [email protected] · Japanese
    Thursday, May 2, 2013 at 18:35:21 · #664055610
    after data
    Name	Address	Phone	Email	 Date	sl No
    Keisuke Hi	3-38-5-301 Hazawa, Nerima-ward, TOKYO, 176-0003, Japan	819038031597	[email protected]	Thursday, May 2, 2013	664055610
    Please check the attachment for better understanding.
    Attached Files Attached Files
    Last edited by nur2544; 09-22-2013 at 11:14 AM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data transpose (from horizontal input to vertical output)

    Try the macro below.

    Sub CONVERTROWSTOCOL_Oeldere_revisted()
    
    Dim rsht1 As Long, rsht2 As Long, i As Long, col As Long, wsTest As Worksheet
    
    'check if sheet "ouput" already exist
    
    Const strSheetName As String = "Output"
     
    Set wsTest = Nothing
    On Error Resume Next
    Set wsTest = ActiveWorkbook.Worksheets(strSheetName)
    On Error GoTo 0
     
    If wsTest Is Nothing Then
        Worksheets.Add.Name = strSheetName
    End If
    
       
       With Sheets("Output")
        .UsedRange.ClearContents
        .Range("A1:B1").Value = Array("Info", "Transposed")
    
        End With
        
        
        rsht1 = Sheets("Input").Range("A" & Rows.Count).End(xlUp).Row
        rsht2 = Sheets("Output").Range("A" & Rows.Count).End(xlUp).Row
        col = 10
        
        For i = 2 To rsht1
                Do While Sheets("input").Cells(1, col).Value <> ""
                rsht2 = rsht2 + 1
                Sheets("Output").Range("A" & rsht2).Value = Sheets("input").Cells(1, col).Value
                Sheets("Output").Range("B" & rsht2).Value = Sheets("input").Cells(i, col).Value
                
         
                col = col + 1
            Loop
            col = 10
        Next
      With Sheets("Output")
      
       .Range("B2:B" & .Rows.Count).SpecialCells(4).EntireRow.Delete
       
       Columns("A:Z").EntireColumn.AutoFit
        
        End With
    End Sub
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Data transpose (from horizontal input to vertical output)

    Hi oeldere, thanks for replay, It is not working for me , please check the attachment, here I have mention that Column A is my input data. And from this input I need output as like row J2 to O2 .

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Data transpose (from horizontal input to vertical output)

    Hi oeldere, I am extremely sorry for my great mistake in the thread problem title, I was not aware at all, how ever your macro was correct as per my previous asking which was “Data transpose (from horizontal input to vertical output)”. Instead of “Data transpose (from horizontal input to vertical output)” , the problem title will be Data transpose (from vertical input to Horizontal output)”. Sorry once again for wasting your valuable time.
    Last edited by nur2544; 09-22-2013 at 11:15 AM.

+ 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. Excel macro to transpose horizontal data to vertical
    By LittleFry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2016, 05:54 AM
  2. Transpose Vertical Data to Horizontal
    By Randu555 in forum Excel General
    Replies: 5
    Last Post: 04-18-2013, 05:05 PM
  3. Replies: 1
    Last Post: 10-03-2012, 02:46 PM
  4. Replies: 2
    Last Post: 06-06-2012, 07:13 PM
  5. transpose data from horizontal to vertical in a specific column
    By elaine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2006, 12:10 PM

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