PC Review


Reply
Thread Tools Rate Thread

Concatenating cells with ones that contain html tags and quotation marks?

 
 
StargateFan
Guest
Posts: n/a
 
      21st Oct 2010
I have 2 columns of text that I need to integrate with html code so
that I can just copy the concatenated text to plug into an html
database of information that will get uploaded to the net. Is there a
way to do this?

Since the concatenating code is sometimes like this, it seems (as per,
http://www.officearticles.com/excel/...soft_excel.htm):

=A2&" "&B2

where extra "text" (in the form of a blank space here between
quotation marks) is added with the ampersands.



How could we do this type of thing, where my exact text to add I'm
showing below in parantheses?:

= (<body><p>) & G2 & (</p><p> </p><p><a href=") & I2 & ("
target="_blank"><img alt="http://...imageURl.jpg" class="jive-image"
src="http://...imageURl.jpg" /></a></p></body>)

There are a lot of quotation marks in the HTML text to add which seems
to interfere with the quotation marks that are required to encase
additional text.

How can we handle all these html quotation marks and broken brackets
and equal signs when concatenating?

Thanks.
 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      22nd Oct 2010
To concatenate literal strings you need to enclose them within double
quotes. It can become complicated when the literal string itself
contains quotes, so I usually make use of CHAR(34) which is the same
as ". So, change all your literal quotes (i.e. those that are needed
within the HTML codes) to CHAR(34), like this in your example:

= "<body><p>" & G2 & "</p><p> </p><p><a href=" & CHAR(34)
& I2 & CHAR(34) & "target=" & CHAR(34) & "_blank" & CHAR(34)
& "><img alt=" & CHAR(34) & "http://...imageURl.jpg" & CHAR(34)
& " class=" & CHAR(34) & "jive-image" & CHAR(34) & "src=" &
CHAR(34) & "http://...imageURl.jpg" & CHAR(34) & " /></a></p></body>"

I've manually split the lines so that we don't get line breaks at
unfortunate points when they appear in your newsgroup reader, but this
is all one formula.

Of course, you could put some of these strings in other cells, so if
you had these strings in the cells quoted:

M2: <body><p>
N2: </p><p> </p><p><a href="
O2: "target=" _blank"><img alt="
P2: http://...imageURl.jpg"
Q2: class="jive-image"src=" NOTE: leading space
R2: /></a></p></body>

then your formula would be:

=M$2 & G2 & N$2 & I2 & O$2 & P$2 & Q$2 & P$2 & R$2

This could be copied down if only G2 and I2 were to change in a series
of similar statements.

Hope this helps.

Pete

On Oct 21, 5:43*pm, StargateFan <Stargate...@mailinator.com> wrote:
> I have 2 columns of text that I need to integrate with html code so
> that I can just copy the concatenated text to plug into an html
> database of information that will get uploaded to the net. *Is there a
> way to do this?
>
> Since the concatenating code is sometimes like this, it seems (as per,http://www.officearticles.com/excel/...soft_excel.htm):
>
> =A2&" "&B2
>
> where extra "text" (in the form of a blank space here between
> quotation marks) is added with the ampersands.
>
> How could we do this type of thing, where my exact text to add I'm
> showing below in parantheses?:
>
> = (<body><p>) & G2 & (</p><p> </p><p><a href=") & I2 & ("
> target="_blank"><img alt="http://...imageURl.jpg" class="jive-image"
> src="http://...imageURl.jpg" /></a></p></body>)
>
> There are a lot of quotation marks in the HTML text to add which seems
> to interfere with the quotation marks that are required to encase
> additional text.
>
> How can we handle all these html quotation marks and broken brackets
> and equal signs when concatenating?
>
> Thanks.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to place quotation marks before and after text in all cells suestew Microsoft Excel Programming 2 5th Oct 2008 08:29 PM
Why do quotation marks change to question marks in e-mails receiv. =?Utf-8?B?SiBIZXJuZG9u?= Microsoft Outlook Discussion 0 30th May 2007 08:01 PM
Adding Quotation Marks to Data already in Mulitple Cells =?Utf-8?B?Um9u?= Microsoft Excel Setup 3 23rd Feb 2007 06:15 PM
how to add quotation marks to many cells at once =?Utf-8?B?S2F0eWEgUg==?= Microsoft Access 6 7th Jun 2006 10:18 PM
Inserting Quotation Marks in all Cells =?Utf-8?B?Y29uZnVzZWQ=?= Microsoft Excel Misc 4 19th Oct 2005 01:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 AM.