+ Reply to Thread
Results 1 to 3 of 3

Combining a range of cells' contents into 1 cell

  1. #1
    Registered User
    Join Date
    05-18-2007
    Posts
    2

    Combining a range of cells' contents into 1 cell

    I'm kind of new to macros and would like to get the code for a task.

    The task is simple: combine the contents of the selected cells into one cell.

    e.g. I have the word "computer" split into 3 consecutive cells in the same row;

    A1="com", B1="put", C1="er"

    I want the macro to cut the contents of the selected cells and paste them together, in the same cell, the first cell selected.

    A1="computer"

    Any ideas appreciated.
    Last edited by macrode; 05-18-2007 at 07:55 PM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This UDF might help. It can be called either from the worksheet or from VB.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-18-2007
    Posts
    2
    The best way to describe the task is - reverse 'text to columns' - I'm not even sure i need a macro.

    Thanks for the reply.

    I pasted the code into a blank macro and got the error "expected end sub". Do i use the 'function'; within the sub, after the sub, or instead of the sub?

    I am new to this so please tell me exactly how to use that code.
    And how do i "call it from the worksheet"

    Thanks
    Last edited by macrode; 05-19-2007 at 11:00 AM.

+ Reply to Thread

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