Results 1 to 17 of 17

Transform data to tabular format

Threaded View

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Transform data to tabular format

    Hello everyone

    I have the data in three columns. The first column is for the IDs and this will be unique in output in column A in output
    The second column would be the headers after the column A in output
    The third column has the values which I need to populate properly in each suitable place in the output
    The attachment will explain better than the description

    Sub Test()
        Dim a, d As Object, d2 As Object, s As String, i As Long, m As Long
    Dim k As Long, c As Long
    
        a = Range("A1:C" & Cells(Rows.Count, 1).End(xlUp).Row).Value
        ReDim b(1 To UBound(a, 1), 1 To UBound(a, 1))
        k = 1: c = 2: b(1, 1) = a(1, 1)
        Set d = CreateObject("Scripting.Dictionary")
       
        For i = 2 To UBound(a)
            If Not d.Exists(a(i, 1)) Then
                k = k + 1
                b(k, 1) = a(i, 1)
               
                d(a(i, 1)) = a(i, 2)
               
                b(1, c) = a(i, 2)
                b(k, c) = a(i, 3)
            Else
                c = c + 1
                b(1, c) = a(i, 2)
                b(k, c) = a(i, 3)
            End If
        Next i
    
        'Range("E10").Resize(d.Count).Value = Application.Transpose(d.keys)
    
    End Sub
    Posted at this link too
    http://www.eileenslounge.com/viewtopic.php?f=30&t=34512
    Attached Files Attached Files
    Last edited by YasserKhalil; 05-01-2020 at 02:26 PM.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VB Code to convert sheet data into tabular format
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2019, 09:05 PM
  2. Import Json data in Excel in a tabular format
    By sabha in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-17-2019, 03:15 PM
  3. [SOLVED] Formula to reorganzie data in tabular format
    By rizmomin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2018, 01:39 PM
  4. [SOLVED] Macro to Format Store Data in a Tabular Format
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2015, 04:38 AM
  5. Transpose data into a tabular format
    By fausto1234 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2012, 02:04 AM
  6. [SOLVED] Transform user entry data to a more tabular form
    By gcoug in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-11-2012, 01:35 PM
  7. How to Convert Matrix format data into tabular format data
    By nishchints in forum Excel General
    Replies: 1
    Last Post: 02-22-2012, 03:53 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