+ Reply to Thread
Results 1 to 8 of 8

Forumula + HTML in a single cell

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    4

    Forumula + HTML in a single cell

    Hello everyone -

    I apologize if this has been asked before. I ran a search and couldn't find anything, so I figured a new thread was my best shot at getting this figured out.

    I'm making a batch upload file for my company to use for an ecommerce site. I have three cells involved in this problem. The first two (A1 and A2) have simple text in them, but the third cell (A3) has to be formatted in HTML code.

    Basically, this is the HTML code I need to have in A3:


    <p><span style="font-family: georgia,palatino; font-size: 14px;">XXX</span></p>
    <p><span style="font-family: georgia,palatino; font-size: 14px;">Model number:&nbsp;YYY </span></p>


    ...where XXX is the text from A1 and YYY is the text from A2.

    Every time I try to use a formula to fetch the text from A1 and A2 and plug it into A3, I get an error from Excel. The only way I've been able to avoid these errors is if I format the column as text-only, but then the fetch formulas don't work for me.

    Any help here would be greatly appreciated. And if there's any further information needed from me, please let me know.

    Thanks in advance, everyone!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Forumula + HTML in a single cell

    What have you tried?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Forumula + HTML in a single cell

    May be:
    ="<p><span style="font-family: georgia,palatino; font-size: 14px;">"&A1&"</span></p>"
    Quang PT

  4. #4
    Registered User
    Join Date
    05-03-2013
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Forumula + HTML in a single cell

    The "&A1" stuff , as bebo021999 posted, is what I'd been trying. When I plug that into the full HTML code I have, I got a popup saying that the formula I typed contains an error. It seems like all the quotation marks and equal signs in the HTML are causing issues with the formula. Then again, I could be totally wrong.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Forumula + HTML in a single cell

    No, your right the quotes are the problem.

    What exactly do you have in the cells?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Registered User
    Join Date
    05-03-2013
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Forumula + HTML in a single cell

    Ok, I've attached a sample workbook. It's just a few example cells.

    A2 and B2 are the cells I'm trying to pull text from, to be inserted into HTML code in C2.

    Here is the full HTML code I'm attempting to use. I don't know if the extra bit at the bottom will make any difference in the errors I'm getting, but better to be safe:

    HTML Code: 
    Again, the XXXXXX and YYYYYY sections correspond to A2 and B2 in the workbook, respectively.
    Attached Files Attached Files

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Forumula + HTML in a single cell

    I thought you had the HTML tags in a cell, if you did this would be straightforward.

    See the updated attachment.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-03-2013
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Forumula + HTML in a single cell

    For some reason, this sort of thing never occurred to me. I was able to get the correct block of code into the cell using the method you demonstrated, but now the upload destination is returning an upload error. Oh well, at least I've got the software issues figured out for now.

    Thank you for your help. I really do appreciate it.

+ 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