Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Write/Paste RTF or HTML string into one cell??

Hi experts,

I have this problem that's stalled me for a few days now: I want to pass
formatted text to an Excel cell. It sounds simple enough, but apparently it
isn't.

The original text can be in RTF or HTML format. The closest I have come is
copying my data as HTML on the clipboard then pasting as HTML, however for
each line break the content gets sent to the next cell. I want to have it all
in one cell.

Anybody has any idea? I don't need to use the clipboard, that's just
something that I thought might work...

Cheers!

Bourgui
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default Write/Paste RTF or HTML string into one cell??

Any code to show ?

If you paste into the cell *while in edit mode* it should all go into the
same cell.

Tim


"Bourgui" wrote in message
...
Hi experts,

I have this problem that's stalled me for a few days now: I want to pass
formatted text to an Excel cell. It sounds simple enough, but apparently
it
isn't.

The original text can be in RTF or HTML format. The closest I have come is
copying my data as HTML on the clipboard then pasting as HTML, however for
each line break the content gets sent to the next cell. I want to have it
all
in one cell.

Anybody has any idea? I don't need to use the clipboard, that's just
something that I thought might work...

Cheers!

Bourgui



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default Write/Paste RTF or HTML string into one cell??

You cannot paste a table into a cell like you can in MS Word.
Nor can you paste text from HTML that has different fonts
attributes for different parts of the line (color, bold, italics) into Excel
like you can in MS Word.

In fact changing the font within parts of a cell can be rather
laborious in Excel. You have to do your selection from
the address bar not from the cell, and you can never have
multiple fonts/colors within a cell at same time unless it is
text (not a formula). I can't find my page but here is Dick's
http://www.dicks-blog.com/archives/2...l-in-cells-ii/

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tim" <tim j williams at gmail dot com wrote in message ...
Any code to show ?

If you paste into the cell *while in edit mode* it should all go into the
same cell.

Tim


"Bourgui" wrote in message
...
Hi experts,

I have this problem that's stalled me for a few days now: I want to pass
formatted text to an Excel cell. It sounds simple enough, but apparently
it
isn't.

The original text can be in RTF or HTML format. The closest I have come is
copying my data as HTML on the clipboard then pasting as HTML, however for
each line break the content gets sent to the next cell. I want to have it
all
in one cell.

Anybody has any idea? I don't need to use the clipboard, that's just
something that I thought might work...

Cheers!

Bourgui





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Write/Paste RTF or HTML string into one cell??

THanks for the reply guys.

@Tim: not really any code to show yet. The formatted text comes from another
application, I really just need this function in Excel to somehow insert the
whole formatted text in one cell.

@Richie: The data is really just a string, that I can export in any format I
want. I was thinking of RTF because it's pretty much standard for formatted
text. HTML came as a second thought when I realised that, for example, if you
copy some formatted text from Word onto the clipboard, HTML is the format (of
the data on the clipboard) that Excel pastes. THe problem is when the text I
try to paste contains line breaks, as each line will then be pasted in
different cells instead of one.

I'm not worried about formulas as it will only ever be text.
I have just thought about getting rid of '<br in the HTML string I'm
passing, while keeping a reference of their position, then inserting 'vbLf'
in the appropriate positions in the cell later on. I'll let you know if it
worked (in case anyone else is trying to do the same thing)

I will check 'Bill' 's blog, thanks

"David McRitchie" wrote:

You cannot paste a table into a cell like you can in MS Word.
Nor can you paste text from HTML that has different fonts
attributes for different parts of the line (color, bold, italics) into Excel
like you can in MS Word.

In fact changing the font within parts of a cell can be rather
laborious in Excel. You have to do your selection from
the address bar not from the cell, and you can never have
multiple fonts/colors within a cell at same time unless it is
text (not a formula). I can't find my page but here is Dick's
http://www.dicks-blog.com/archives/2...l-in-cells-ii/

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tim" <tim j williams at gmail dot com wrote in message ...
Any code to show ?

If you paste into the cell *while in edit mode* it should all go into the
same cell.

Tim


"Bourgui" wrote in message
...
Hi experts,

I have this problem that's stalled me for a few days now: I want to pass
formatted text to an Excel cell. It sounds simple enough, but apparently
it
isn't.

The original text can be in RTF or HTML format. The closest I have come is
copying my data as HTML on the clipboard then pasting as HTML, however for
each line break the content gets sent to the next cell. I want to have it
all
in one cell.

Anybody has any idea? I don't need to use the clipboard, that's just
something that I thought might work...

Cheers!

Bourgui






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop excel from processing HTML? IE paste raw html. nick Excel Discussion (Misc queries) 2 April 21st 23 05:12 PM
Write formula for simple copy and paste to another cell Kalffiend Excel Worksheet Functions 1 January 12th 10 09:10 PM
How to paste multiline HTML into a single cell in Excel 2003? Ker_01 Excel Discussion (Misc queries) 2 February 22nd 08 11:57 AM
Write HTML Scripts On Excel Dileep Chandran Excel Worksheet Functions 0 November 10th 06 04:46 AM
Can not write string to a cell wmauss[_3_] Excel Programming 2 June 19th 04 08:56 AM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"