Consulting

Results 1 to 3 of 3

Thread: Concatenate Transpose - Multiple with Multiple

  1. #1
    VBAX Mentor
    Joined
    Feb 2016
    Location
    I have lived in many places, I love to Travel
    Posts
    413
    Location

    Concatenate Transpose - Multiple with Multiple

    Good day folks,

    i am needing some transpose and concatenation help.



    Car A Car A House A
    House B Car B House B


    I wanted to create some results.

    Each item in column A with each item in column B

    so that it looks like the above

    But i have failed to transpose and concatenate effectively.

    Or is this better if i create a formula that i insert with vba?
    Cheers for your help

    dj

    'Extreme VBA Newbie in progress - one step at a time - like a tortoise's pace'


  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
     Option Explicit
    
    
     Sub test()
        Dim v()
        Dim n As Long
        Dim i As Long, j As Long
        
        With Cells(1).CurrentRegion
            n = .Rows.Count
            ReDim v(1 To n, 1 To n)
            For i = 1 To n
                For j = 1 To n
                    v(j, i) = .Cells(i, 1).Value & " " & .Cells(j, 2).Value
                Next
            Next
        End With
        
        Cells(4).Resize(n, n).Value = v
        
     End Sub

  3. #3
    VBAX Mentor
    Joined
    Feb 2016
    Location
    I have lived in many places, I love to Travel
    Posts
    413
    Location
    Thank you Mana,

    that is amazing!!!

    I can put away all those horrid concatenation formulas. they were long

    =TRANSPOSE(CONCATENATE(“A2″,”A3″,”A4″,”A5″,”A6″,”A7”.....and something else

    I did do some multiplication but that was as far as i could go

    Thank you very much for this mathematical wizadry

    I have a long column of things to combine now - happy days

    Have a great day!!
    Cheers for your help

    dj

    'Extreme VBA Newbie in progress - one step at a time - like a tortoise's pace'


Posting Permissions

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