Results 1 to 5 of 5

Transpose web data from horizontal (rows) to vertical (columns)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116

    Transpose web data from horizontal (rows) to vertical (columns)

    Hye Excel Expert,

    Attached is the sample of web data for transpose process. Generally, each portion is a group of data consists of the following parameters:-

    Work Order ID
    Submit Date
    Submitter
    Communication Source
    View Access
    Notes

    The source data (web data) is in horizontal mode and every portion is separated by a line. If we see the pattern for the value for each parameter, each parameter only has 1 row value, EXCEPT parameter 'Notes' that may vary from 1 portion to another. However, I need the output to be as the following (with sample data):-

    Work Order ID Submit Date Submitter Communication Source View Access Notes
    WO0000000075830 *04/01/2018 7:47:35 PM *v04784x * Public * User ID have been created.refer attachment.TQ.

    I have hundreds of web data files in a folder in local PC. I need a macro that can loop all web data files in the folder, transpose each portion from horizontal (rows) to vertical (columns) manner with the parameter names as the header which needs only to be published once in one master worksheet. I manage to find one macro that can transpose but the macro only limits to a fixed number of columns, which will not be applicable when the number of rows as values in parameter 'Notes' is consists of multiple rows (inconsistent number of rows).

    Below is the macro I found that I think very close-relation to my problem.

    Public Sub TransposeData()
    'updateby Extendoffice 20151207
        Dim xLRow As Long
        Dim xNRow As Long
        Dim i As Long
        Dim xUpdate As Boolean
        Dim xRg As Range
        Dim xOutRg As Range
        Dim xTxt As String
        On Error Resume Next
        xTxt = ActiveWindow.RangeSelection.Address
        Set xRg = Application.InputBox("Please select data range(only one column):", "Kutools for Excel", xTxt, , , , , 8)
        Set xRg = Application.Intersect(xRg, xRg.Worksheet.UsedRange)
        If xRg Is Nothing Then Exit Sub
        If (xRg.Columns.Count > 1) Or _
           (xRg.Areas.Count > 1) Then
            MsgBox "the used range only contain one column", , "Kutools for Excel"
            Exit Sub
        End If
        Set xOutRg = Application.InputBox("please select output range(specify one cell):", "Kutools for Excel", xTxt, , , , , 8)
        If xOutRg Is Nothing Then Exit Sub
        Set xOutRg = xOutRg.Range(1)
        xUpdate = Application.ScreenUpdating
        Application.ScreenUpdating = False
        xLRow = xRg.Rows.Count
        'For i = 1 To xLRow Step 5
        For i = 1 To xLRow Step xLRow
            'xRg.Cells(i).Resize(5).Copy
             xRg.Cells(i).Resize(xLRow).Copy
            xOutRg.Offset(xNRow, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
            xNRow = xNRow + 1
        Next
        Application.ScreenUpdating = xUpdate
    End Sub


    Can anyone help me, please?

    Tqvm in advance.
    DZ
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Dahlia; 08-10-2018 at 05:26 AM. Reason: attach file

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Transpose vertical data to horizontal
    By PeterKeown in forum Excel General
    Replies: 6
    Last Post: 08-03-2018, 05:51 AM
  2. Transpose huge data from horizontal to vertical
    By AaruJaan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2017, 12:13 PM
  3. Replies: 3
    Last Post: 04-27-2015, 05:26 PM
  4. Replies: 4
    Last Post: 08-22-2013, 11:56 AM
  5. [SOLVED] Converting Vertical Columns in to Horizontal Rows - (Better solution to Transpose)
    By ps_upasani in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-30-2013, 05:32 AM
  6. Transpose Vertical Data to Horizontal
    By Randu555 in forum Excel General
    Replies: 5
    Last Post: 04-18-2013, 05:05 PM
  7. Replies: 2
    Last Post: 06-06-2012, 07:13 PM

Tags for this Thread

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