+ Reply to Thread
Results 1 to 5 of 5

Retain formatting during concatenation

  1. #1
    Registered User
    Join Date
    02-06-2008
    Location
    Cheshire, UK
    Posts
    42

    Retain formatting during concatenation

    Hi

    I'm concatenating data in 5 cells (Author, Year, Title, City, Publisher), one of which is in italics (Title). When using concatenate (or &) the formatting is removed, and I need to be able to retain that formatting.

    Example:
    Col B
    Aaron, M. (ed)
    1999
    The Body's Perilous Pleasures.
    Endinburgh
    Edinburgh University Press


    Please Login or Register  to view this content.
    Gives is:
    Aaron, M. (ed) (1999) The Body's Perilous Pleasures. Endinburgh: Edinburgh University Press

    Whereas I need:
    Aaron, M. (ed) (1999) The Body's Perilous Pleasures. Endinburgh: Edinburgh University Press

    Is there any way to do this?

    Hope you can help.

    NoCanDo
    Last edited by NoCanDo; 02-04-2009 at 03:17 PM. Reason: Solution (for me)

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Retain formatting during concatenation

    As your name says... I think it's a NoCanDo
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Retain formatting during concatenation

    Hello NoCanDo,

    It can be done using VBA code. Here is the macro code. This has been added to the attached workbook. To run the macro, click the button labeled "Concatenate" on "Sheet1".
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Retain formatting during concatenation

    Well, I guess maybe it can.... oops! Should've known better than not to trust VBA to do the trick...

    Then its a YesCanDo.

  5. #5
    Registered User
    Join Date
    02-06-2008
    Location
    Cheshire, UK
    Posts
    42

    Re: Retain formatting during concatenation

    Many thanks to you guys for the assistance, Leith - looks good with the VB approach - will check it out. However, I've found an easier (to me) way.

    Make sure the cells are formatted as you want them
    Copy the cells required
    Paste it all into MS Word
    Highlight table it creates in MS Word and convert to text, using a 'space' as the separator when converting.
    Highlght all paragraphs in MS Word
    Paste back into MS Excel

    Hey presto it works:

    Aaron, M. (ed) 1999 The Body's Perilous Pleasures. Endinburgh: Edinburgh University Press
    Aaron. J. & Walby, S. (eds) 1991 Out of The Margins. Women's studies in the nineties. London: Falmer Press

    Thanks to all

    NoCanDo (but I achieved in the end!)

+ 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