Results 1 to 5 of 5

VBA Automatically concatenate cell data based on data, and prefix with specific word.

Threaded View

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    37

    VBA Automatically concatenate cell data based on data, and prefix with specific word.

    Hi,

    Could anyone help me with what may be a simple solution using VBA please? What I am trying to do is to take all values from (for example) cells A2 to G2 and concatenate those values into cell H2, seperated by a comma, or to leave a comma out (skip it) if no data exists in any of those cells:

    For example if all cells have data:
    A2 B2 C2 D2 E2 F2 G2 H2
    I Am A Real Piece Of Work I, Am, A, Real, Piece, Of, Work

    For example if NOT all cells have data:
    A2 B2 C2 D2 E2 F2 G2 H2
    I Am A Piece Work I, Am, A, Piece, Work

    But I would like to do this on the worksheet_change function so that it updates H2 each time it leaves one of the cells in the row, data or not.

    I have an additional requirement that if cell A2 contains a specific word/number, the finished concatenation in cell H2 is prefixed with a certain word, i.e. "Hi", so that the result would be:

    Hi, I, Am, A, Real, Piece, Of, Work

    Any help would be greatly appreciated, I have searched all over this board to find a result, but none that work with the worksheet_change function, or at least without having to call a macro each time.

    Thanks in advance!
    Jamie
    Last edited by jamieswift1977; 01-30-2017 at 12:03 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Concatenate Cell Value by specific range and specific data
    By ivhysenbelli in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2016, 12:04 PM
  2. [SOLVED] Add a prefix word to cells using Concatenate method ... but not working for me..
    By PeteMeehan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2016, 08:38 PM
  3. How to get and automatically updated monthly average based on data from specific dates.
    By daveneedshelp123 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-04-2013, 03:41 AM
  4. Really easy task - automatically entering data based upon matches in a specific column
    By isthisthewaywego in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2013, 09:00 AM
  5. [SOLVED] Automatically copy data from one worksheet to another based on a specific word entered
    By arkadd61 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 08:23 PM
  6. [SOLVED] Concatenate based on cell data
    By Healthport - Jamie in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-13-2012, 03:04 PM
  7. [SOLVED] Automatically create graphs based on specific data
    By Tino XXL in forum Excel General
    Replies: 2
    Last Post: 01-27-2012, 04:48 AM

Tags for this Thread

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