+ Reply to Thread
Results 1 to 5 of 5

Macro to concatenate cells

  1. #1
    Registered User
    Join Date
    08-04-2013
    Location
    rotterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to concatenate cells

    Hi, I've been stuck for a few hours with merging data from different cells into one. Now, I know how to do this by useing a formula, but im looking for a vba solution.

    I have data generated by a macro in Cell E3 to E50. Depending on user input, cells can be blank (a macro is allready sorting the cells with data up. So its possible that only cells e3:e5 have a value. or depending on input cells e3:e15 have a value)


    E
    3 test 1
    4 test 2
    5 test 3


    Now I would like to merge that input in cell E1 like this:

    E
    1 test 1
    test 2
    test 3


    So each piece of data on a new line.

    Im new with macro's etc., so be gentle with me

    Hope someone can help

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to concatenate cells

    What is the criteria for merging the cells? Do you have a sample file that you can upload?

    Ensure that it has the same format as the original and input dummy data.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-04-2013
    Location
    rotterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to concatenate cells

    Hi Arlu,

    Thank you for your reply.
    The criteria is that if cells in the range e3:e20 have a value, it needs to merge those values in cell e1 (and each value on a new line)

    isolating this particulair bit from the rest of my (massive) project will be quite a challange, so the sample file I can provide would be very basic..
    Not sure if that would be of use for you. But ok, attached

    Regards,
    Steven
    Attached Files Attached Files

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to concatenate cells

    Hi Steven,
    maybe so
    Please Login or Register  to view this content.

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

    Re: Macro to concatenate cells

    Please Login or Register  to view this content.

+ 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] Macro to concatenate cells adjacent to duplicates
    By 084851 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2013, 09:18 AM
  2. [SOLVED] Concatenate - Macro way with checking of null cells
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-07-2013, 05:16 PM
  3. macro to concatenate, delete and shift cells
    By three_jeeps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2011, 02:27 PM
  4. [SOLVED] Macro to concatenate previously selected cells
    By Grumpy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2005, 08:55 PM
  5. Replies: 3
    Last Post: 06-11-2005, 07:05 AM

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