+ Reply to Thread
Results 1 to 8 of 8

Distributing row data into columns'

  1. #1
    Forum Contributor
    Join Date
    09-23-2020
    Location
    Turkey
    MS-Off Ver
    Office Pro Plus 2016 TR
    Posts
    140

    Distributing row data into columns'

    Hello,

    I opened a thread with this topic.Dear Jindon had written a code with the subject.
    But I couldn't find my thread link.

    Dear Jindon, would you look again? I had to reopen the issue.
    I marked the issue as resolved.I unchecked it because there was an error.I opened this thread again because I couldn't find the link.


    I'm sorry if I did something wrong



    Sub test()
    ' jindon

    Dim a, b, i As Long, n As Long, t As Long, txt As String
    With Sheets("price").Cells(1).CurrentRegion
    a = Application.Index(.Value, Evaluate("row(2:" & .Rows.Count & ")"), [{3,7,14,12,15}])
    End With
    ReDim b(1 To UBound(a, 1), 1 To UBound(a, 1))
    With CreateObject("Scripting.Dictionary")
    For i = 2 To UBound(a, 1)
    txt = Join(Array(a(i, 1), a(i, 2)), Chr(2))
    If Not .exists(txt) Then
    .Item(txt) = Array(.Count + 1, 2)
    b(.Item(txt)(0), 1) = a(i, 1)
    b(.Item(txt)(0), 2) = a(i, 2)
    End If
    b(.Item(txt)(0), .Item(txt)(1) + 1) = Join(Array(a(i, 3), a(i, 4), a(i, 5)), " ; ")
    .Item(txt) = Array(.Item(txt)(0), .Item(txt)(1) + 1)
    If t < .Item(txt)(1) Then t = .Item(txt)(1)
    Next
    i = .Count
    End With
    With Sheets("summary").Cells(1).Resize(, UBound(a, 2))
    .Value = a
    .Cells(1, 3).Resize(, t - 2) = .Cells(1, 3)
    .Rows(2).Resize(i, t) = b
    End With
    End Sub
    Attached Files Attached Files
    Last edited by Tacir; 08-03-2022 at 03:14 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,663

    Re: Distributing row data into columns'

    Yeah, that's weired.
    This is my second time that the thread I posted had been disappered.

    And what's the problem?
    It is working for me.

  3. #3
    Forum Contributor
    Join Date
    09-23-2020
    Location
    Turkey
    MS-Off Ver
    Office Pro Plus 2016 TR
    Posts
    140

    Re: Distributing row data into columns'

    Hello Dear Jindon .


    Stock codes give an error with the same ones

    I showed an example in the last file I added
    in message 1
    Last edited by Tacir; 08-04-2022 at 03:14 AM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,663

    Re: Distributing row data into columns'

    Error?

    Which line and what was the error message?
    Last edited by jindon; 08-04-2022 at 03:16 AM.

  5. #5
    Forum Contributor
    Join Date
    09-23-2020
    Location
    Turkey
    MS-Off Ver
    Office Pro Plus 2016 TR
    Posts
    140

    Re: Distributing row data into columns'

    https://www.hizliresim.com/n38s3u1

    i tried in single group stock codes

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,663

    Re: Distributing row data into columns'

    when you get error, you should upload the workbook that gives you error.
    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-23-2020
    Location
    Turkey
    MS-Off Ver
    Office Pro Plus 2016 TR
    Posts
    140

    Re: Distributing row data into columns'

    Dear Jindon,

    After change formula seems to work
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-23-2020
    Location
    Turkey
    MS-Off Ver
    Office Pro Plus 2016 TR
    Posts
    140

    Re: Distributing row data into columns'

    Dear Jindon,

    I tried a few more times, it works fine.
    Thank you for your help. Best regards.
    The issue has been resolved.

+ 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] distributing/concatenating values from multiple columns
    By vlady in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-20-2013, 05:10 AM
  2. Replies: 6
    Last Post: 07-23-2013, 10:23 AM
  3. [SOLVED] Splitting string and distributing to columns with VBA (conditional)
    By knutfh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2013, 05:02 PM
  4. Distributing values from existing column to two new columns
    By burman.p in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-04-2013, 02:57 PM
  5. Replies: 2
    Last Post: 01-07-2010, 03:06 AM
  6. Distributing Data
    By Milnet in forum Excel General
    Replies: 6
    Last Post: 08-10-2009, 02:55 AM
  7. Distributing one column amongst multiple columns.
    By ExcelNoob21222 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2008, 02:26 PM
  8. Distributing values from rows to columns for Access import
    By Petterq in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-10-2005, 05:05 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