+ Reply to Thread
Results 1 to 6 of 6

Concatenating columns

  1. #1
    Registered User
    Join Date
    11-12-2008
    Location
    UK
    Posts
    10

    Concatenating columns

    I have to add the extension .jpg to a very long column of reference numbers to turn them into filenames so that ...

    VCTAHBC3
    VCTAHSP
    FAIP481516
    etc.

    ... becomes ...

    VCTAHBC3.jpg
    VCTAHSP.jpg
    FAIP481516.jpg
    etc.

    I've seen the following solution in another thread ...

    A1 contains 999
    B1 contains Z

    in C1 put =concatenate(A1,B1) (giving 999Z)

    then drag down as required.
    ... but being thick I don't know what "then drag down as required" refers to - does it mean drag C1 down so it includes C1 to C3? I've tried that and I only get the result for the first row; "VCTAHBC3.jpg". I've also tried dragging A1 down to A3 but got the same result.

    How can I make this work so that the contents of one column are added to the contents of another?

    Malcolm

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Please Login or Register  to view this content.
    Just put in the first formula in B (or C, whatever) then copy it down the rest of the column.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Concatenating columns

    Perhaps this will work for you....

    Select the cells to have the file extension appended.

    From the Excel Main Menu:
    <format><cells><number tab>
    Category: Custom
    Type: @".jpg"
    Click [OK]

    Note: The VALUE of the cells will not change, but they will display .jpg
    after the contents.

    Example:
    A1 contains Alpha
    but displays Alpha.jpg

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    11-12-2008
    Location
    UK
    Posts
    10
    Quote Originally Posted by Ron Coderre View Post
    Perhaps this will work for you....

    Select the cells to have the file extension appended.

    From the Excel Main Menu:
    <format><cells><number tab>
    Category: Custom
    Type: @".jpg"
    Click [OK]

    Note: The VALUE of the cells will not change, but they will display .jpg
    after the contents.

    Example:
    A1 contains Alpha
    but displays Alpha.jpg

    Is that something you can work with?
    I didn't think it would but it did! As you say, the .jpg extension isn't displayed in the VALUE initially, but it does display there after I've closed and re-opened the file. I was therefore able to import the data into the ecommerce site I'm working on - thank you!

    The next problem is that I now need to add some characters before and after some text in a cell. HTML in plain text fields in the software is enclosed within the tags !!< and >!!

    Example - This is <b>bold</b> text has to be changed to !!<This is <b>bold</b> text>!!

    I can now add something to the end of the text, thanks to your instructions, but is it possible to add something to the beginning?

    Malcolm

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    You do this using the same solution offered above. A CUSTOM FORMAT in a cell can have additions in front or behind the raw data. The format can be: "!!"@".jpg"

    Basically anything inside double quotes gets added where you put it. The @ is your data.

  6. #6
    Registered User
    Join Date
    11-12-2008
    Location
    UK
    Posts
    10
    Works a treat - you are a rocket scientist

+ 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