Consulting

Results 1 to 3 of 3

Thread: Function "&" with 2 columns

  1. #1
    VBAX Newbie
    Joined
    Sep 2015
    Posts
    4
    Location

    Question Function "&" with 2 columns

    Hello!

    I would like to use VBA for this but I don't know how to.

    I have letters in the first column and numbers in the second one but there can be hundreds as there can be only one in each column. I want to have what's in the third column, I mean every combination possible between letters and numbers.

    What can I do with VBA ?

    Thanks for your help!

    A 1 A1
    B 2 A2
    C B1
    B2
    C1
    C2

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    Something like:
    Set Colm1 = Range(Cells(1, "A"), Cells(Rows.Count, "A").End(xlUp))
    Set Colm2 = Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
    DestnRow = 0
    'Colm1.Select
    'Colm2.Select
    For Each cll In Colm1.Cells
      For Each celle In Colm2.Cells
        DestnRow = DestnRow + 1
        Cells(DestnRow, "C") = cll.Value & celle.Value
      Next celle
    Next cll
    End Sub
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Newbie
    Joined
    Sep 2015
    Posts
    4
    Location
    Thanks a lot!

Tags for this Thread

Posting Permissions

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