Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stop excel from processing HTML? IE paste raw html. | Excel Discussion (Misc queries) | |||
Write formula for simple copy and paste to another cell | Excel Worksheet Functions | |||
How to paste multiline HTML into a single cell in Excel 2003? | Excel Discussion (Misc queries) | |||
Write HTML Scripts On Excel | Excel Worksheet Functions | |||
Can not write string to a cell | Excel Programming |