Generating a excel document

I'm exporting text contained within a HTML table to an Excel file.
The text within a single td tag at times contains the br tag.  My
problem is when this data is opened in Excel.  I would expect to see a
group of text in a single cell broken up on multiple lines.  But what
actually happens is that the br tag in excel actually forces the text
to be in another cell on the next row.

Example:

<td>This is some text<br>that is broken<br>up on multiple lines</td>

when opened in Excel doesn't display in a single cell, it ends up
being in two cells on two rows....

When you have Excel open, the way this is accomplished is by just
entering some text in the cell, then hitting the <Alt>+<Enter>, then
entering more text... but how do I get the equivalent programatically?

Thanks in advance,
Wes
0
8/1/2008 7:23:19 PM
excel 39879 articles. 2 followers. Follow

1 Replies
458 Views

Similar Articles

[PageSpeed] 19

Select you cells to be joined, and run:


Sub joincellsinonecell()
    
    Dim x As Variant
    Dim sTemp As String
    
    With Selection
        
        ReDim x(.Rows.Count - 1)
        
        x = .Cells
        
        sTemp = Join(WorksheetFunction.Transpose(x), Chr(10))
        
        .ClearContents
        
        .Cells(1) = sTemp
    
    End With

End Sub


Of course, selecting the cells could be done using other code.


-- 
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Wes" wrote:

> I'm exporting text contained within a HTML table to an Excel file.
> The text within a single td tag at times contains the br tag.  My
> problem is when this data is opened in Excel.  I would expect to see a
> group of text in a single cell broken up on multiple lines.  But what
> actually happens is that the br tag in excel actually forces the text
> to be in another cell on the next row.
> 
> Example:
> 
> <td>This is some text<br>that is broken<br>up on multiple lines</td>
> 
> when opened in Excel doesn't display in a single cell, it ends up
> being in two cells on two rows....
> 
> When you have Excel open, the way this is accomplished is by just
> entering some text in the cell, then hitting the <Alt>+<Enter>, then
> entering more text... but how do I get the equivalent programatically?
> 
> Thanks in advance,
> Wes
> 
0
Wigi (97)
8/2/2008 10:06:17 AM
Reply:

Similar Artilces:

ExcelReport
Please access http://www.ljzsoft.com ExcelReport is a report generator to generate reports in Microsoft Excel format. If you know how to use Excel and write SQL statements, you can use ExcelReport to create all kinds of reports as you need. Furthermore, with one time configuration, you can easily build periodic reports such as daily, weekly, monthly and annual reports. ...

Is it possible to make Labels from Excel?
I'm not sure if it can be done, our database is strickly Excel and I'd like to make labels from the Names & addresses we have listed on there. Can it be done stricktly from excel? Hi Julia, Not an easy task without a lot of programming. But you can use an Excel database as the source file for Word 'mail-merge' and hence make labels. Bernard "Julia" <anonymous@discussions.microsoft.com> wrote in message news:001501c3a3b8$08937fa0$a301280a@phx.gbl... > I'm not sure if it can be done, our database is strickly > Excel and I'd like to make la...

Dynamically generating email as html from a template
Would anyone know of an article/information detailing the creation of templates in word that can be used to create word documents by merging data to be saved as html to be included as the body of an email in outlook. .... or another method of dynamically creating emails in outlook based on a template. Thanx for the Advice Have you looked at Word's mail merge feature? That's exactly what it = does. See http://www.slipstick.com/contacts/startletter.htm=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Us...

Import excel into publisher
It would be beneficial, if Publisher had the capibilities to import Excel spreadsheets to keep data up-to-date. I read that it is NOT possible, or is there something I missed? Import excel into publisher wrote: > It would be beneficial, if Publisher had the capibilities to import Excel > spreadsheets to keep data up-to-date. I read that it is NOT possible, or is > there something I missed? You can Mail Merge from Excel spreadsheets, and you can insert an Excel sheet as an OLE object. Does that not cut the mustard? -- Ed Bennett - MVP Microsoft Publisher http://ed.mvps.org ...

Excel 2003 versus Excel 2007 calculation speed
I'm running an interesting test on a PC of Excel 2003 and Excel 2007. I ran a Monte Carlo simulation in Excel 2003. The workbook has 50 input cells (cells where random values per distributions are input) and 200 calculation (formula) cells. So, it is basically a small workbook. No conditional formatting. No charts. The VBA code calculates random values per distributions and puts into the input cells. The workbook is then recalculated and the values of the input and output cells (20 of the formula cells) are recorded. Only cell values are recorded - formatting is not set on ...

How do I Add Data at the beginning of multiple cells in Excel?
I have an excel document that I am trying to add the letters "PH:" in front of already existing data (phone #'s) to help create a directory of sorts... Need to know if theres a way add this at the beginning of data in multiple cells all at once? Any help is appreciated... Hi, let's assume your data is in column A, then in another column enter ="PH"&A1 copy formula down, if you want an space between PH and the data use ="PH"&" "&A1 "Leigh" wrote: > I have an excel document that I am trying to add ...

Starting Excel #2
How can make sure that a workbook with multiple sheets always starts on a specific sheet. Hi put the following type of code into your workbook module ('Thisworkbook'): sub workbook_open() me.worksheets("sheet1").activate end sub "Gerrym" wrote: > How can make sure that a workbook with multiple sheets > always starts on a specific sheet. > ...

Error Generating the Offlice Address Book
I have a mixed site with 3 5.5 server and 4 2003 servers. I installed 2003 SP1 a few weeks back and since then I'm having an issue generating my Offline Address Book. Here the event log messages I'm getting. Event ID 9331: OALGen encountered error 80040107 (internal ID 501023d) accessing the public folder store while generating the offline address list for address list '/'. - Default Offline Address List For more information, click http://www.microsoft.com/contentredirect.asp. Event ID 9335: OALGen encountered error 80040107 while cleaning the offline address list public ...

Preventive Maintenance, multiple call generation 1 generate to pr.
need to be able to have preventive maintenance generate a call for each day in a month when running the generate routine. Rather than having to create each one individually. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/...

Excel
I am working with a spreadsheet on a split screen. When I do a "find" and the cursor is in the bottom half of the split, the cursor jumps to the find, but it is in the center of the screen. Is there some setting that allows the find to jump to the top instead of the center of the page? I don't think there is any way to change the location of the dialog box. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "SonnyBubba" <SonnyBubba@discussions.microsoft.com> wrote in message news:50128487-8D37-4E3B-B1B1...

unable to paste/import graph from excel onto word on single page
If I paste the graph in word it shows up in 2 pages and if I try to import it cuts half and shows the rest in one page. Please help! How can i make the whole graph look good in word like the way it shows in Excel? Right-click the graph, click format object, layout tab, select any wrap but inline with text. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Word query4 hortresearch" <Word query4 hortresearch@discussions.microsoft.com> wrote in message news:1FC73B8C-D034-4B52-9DFE-29E652C41A10@microsoft.com... > ...

page numbering in excel #5
How can I have page numbers show up in portrait style while the data is in landscape? Is this possible? ...

PROVEN SYSTEM TO GENERATE CASH
Hi friends, I think it be a very promising program .... the great thing about it is they market it for you! Easy, once you join all of this happens without you lifting a finger! You automatically received your replicated Unique URL (personal web site) You automatically have 150,000+ emails sent to promote your web site You automatically have people (just like you) visit your web site You automatically have welcome emails sent to your new prospects You automatically have 10 days of follow-up (drip) emails sent to your new prospects The System automatically processes the new member when they...

vs2005 xsd.exe: Can it generate different files?
Is there an option to get the vs2005 xsd.exe tool to generate seperate files for each class that it generates? It would be much easier from a maintenance standpoint than one big giant file for my classes. Thanks for any help Matt MattBell wrote: > Is there an option to get the vs2005 xsd.exe tool to generate seperate files > for each class that it generates? I had a look at the output of xsd.exe /help but there is no option/setting mentioned. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ ...

How can I combine multiple cells in Excel?
I am trying to combine column A(last name) and column B(first name). I have tried to use Excel help, but am not getting any results. Please explain how I can do this. Thank you. Hi in an adjacent column =B1 & " " & A1 or =CONCATENATE(B1," ",A1) or reverse the A1/B1 depending on how you want the combined name displayed. You can then copy this formula down the list of names and select the column copy it and then edit / paste special - values to change the column from being a formula into the actual names for use later on. Cheers JulieD "jallbright24...

to generate only table names but not their schema in the database
My replication on multiple servers failed. So i want to know which articles are published from the daabase. i wish to generate only articles that are there in the database, but not their schema or column names. how to do this through ms visio ...

Auto-generate product ID
Is there a way to auto-generate product ID? Or is there any third party addons that does that? Better yet would be a way to auto-generate a barcode for each item "Raymond" <Raymond@discussions.microsoft.com> wrote in message news:F1EF7ACB-8D15-4527-A8C7-53C9F8FD6906@microsoft.com... > Is there a way to auto-generate product ID? Or is there any third party > addons that does that? Raymond, We offer AutoGen for this purpose. Barcode 128A is the default for new item adds. For more information contact your RMS reseller or visit: http://www.digitalretailer.com/rmsaddin...

EXCEL 2007 no longer add properly
In cell k17 I have the number 1 in cell l17 I have the number 2 in cell m17 I have the formula =+k17+l17(and the answer is 3 as it should be) Here is the trouble. If I copy cell M17 down to M18 thru m20 I still get the answer as 3 but there are no number in the k18 and l18 or k19 and l19 or k20 and l20 What has gone wrong? Thanks Hi, Did you recalcule the spreadsheet - press F9? If this is the problem, then choose Tools, Options, Calculation, Automatic -- Thanks, Shane Devenshire "pcor" wrote: > In cell k17 I have the number 1 > in cell l17 I have the number 2 > ...

Macros in Excel Viewer?
Does anyone know if it is possible to use MACROS in excel viewer? I created the program in Excel 2003. Would it be possible to run this program using Viewer? Hi no, this is not possible. Sorry to say -- Regards Frank Kabel Frankfurt, Germany DB wrote: > Does anyone know if it is possible to use MACROS in excel > viewer? > > I created the program in Excel 2003. Would it be possible > to run this program using Viewer? ...

Auto Generate Serial Numbers for Bill of Materials
Hi! We have a partner in Australia who has some issues with the Serial Number Masks for Finished Goods in Inventory. Currently Bill of Materials functions this way: If the customer creates 20 finished products which tracks Serial Numbers. The user has to manually enter the 20 serial numbers into Assembly Entry. Even though the Finished product has been setup with a Serial Mask, there is no option to Auto Generate Serial Numbers. He would like to suggest that there should be an auto generate serial number function also for the finished goods in Bill of Materials. Thanks, ---------...

document() function problem
I am trying to use the document function inside an ASP.Net control, specifically a SharePoint Web Part. For whatever reason, the function always seems to return an empty node set. I am providing a resolver to both the Load method and the transform but it doesn't seem to matter. I then derived my own resolver from XmlUrlResolver and placed Debug.WriteLine calls inside the constructor, GetEntity() and ResolveUri(). When viewing the debug information printed, I only see the call to the constructor. It seems the XslTransform class is not even trying to use the resolver. This dll has a co...

how to generate a range of number
Howdy folks, I would like to know how to generate a range of number (for example: 10000 to 19999) in excel without typing them in each number into each cell one by one. Your help would boot up my business significantly. Gracias, Vito Corleone, President Check out the Edit|Fill, Series options. If you want the numbers to go down a column, make sure you click the Columns choice. tj "Vito Corleone" wrote: > Howdy folks, > > I would like to know how to generate a range of number > (for example: 10000 to 19999) in excel without typing them > in each number int...

Viewing multiple excell spreadsheets on the task bar
Why is it that when I have 3 or more excell spreadsheets open they are not all listed on my task bar the only way I can get to them is by going to the window button and selecting the one I want to see, I want to be able to ALT TAB between them and they are not listing them for me in the task bar only the current one I have open? Are you using XP? Sounds like that feature of XP which groups several windows of one application into one spot on the task bar. There may be a way to shut this off in taskbar properties. Click on the task bar and select properties. "Megan" wrote: ...

Automatic Functions in Excel
Hi There I am developing a Time Sheet in Excel for Staff to record times worked on it. I am using the 1904 date system as occasionally a negative total will be displayed. I would like it if someone was on annual leave they would be able to record this by typing in "Annual Leave" or "A/L" or something similar then the total for that day to display as 7:00 (this is in hours). At present the "total" column runs a calculation of the time finished minus the time started. Is this possible? Regards Colin Hi Colin, StartTime in column A, end ti...

excel to access problem
Hi everybody, I am stuck trying to get access to retrieve data from excel using ado. I don't know what i'm doing wrong and wish for someone to help me. I created a test folder with and excel workbook named testbook and an access db named db1 the table i'm trying to add info to is named table1. The code I used is below. Can someone tell me what I've done wrong? The three field names in the access db is as follows: field1 = Date field2 = Name field3 = Address I have the same names in the excel spreadsheet. I went into the VBE and clicked on Tools/References and moved Microso...