Results 1 to 3 of 3

Concatenate two columns VBA macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Smile Concatenate two columns VBA macro

    Hello, I am running Excel 2003 on Windows XP and hope some one can please help me fix my VBA macro:

    Sub Concatenate_TextColumns()
    Dim FirstGivenName As Variant
    Dim SecondGivenName As Variant
    ‘
    Range("G2").Select
    ‘
    For Each SecondGivenName In Range("F2:F65500")
        For Each FirstGivenName In Range("E2:E65500")
            ActiveCell.Formula = FirstGivenName & " " & SecondGivenName
            ActiveCell.Offset(1, 0).Select
        Next
    Next
    ‘
    Range("G1").Select
    ‘
    End Sub
    The following image shows what I want and what I acrually get:

    Figures 1 and 2.jpg

    I have just re-edited this post with better screen-shots below:

    Figure 1 - shows what I do want:

    Figure 1.jpg

    Figure 2 - shows what I am getting when I run the above macro (which I do not want):

    Figure 2.jpg


    Kind regards,

    Chris
    Last edited by longbow007; 10-23-2012 at 11:20 PM.

Thread Information

Users Browsing this Thread

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

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