473,508 Members | 2,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting to excel and column data with carriage returns

I'm using the following function (I'm displaying the guts of it only) to
convert a datatable to an excel spreadsheet:

For Each mrow In dt.Rows
rowindex += 1

colindex = 0

For Each col In dt.Columns

colindex += 1

objws.Cells(rowindex, colindex) = mrow(col.ColumnName).ToString()

Next

Next

It works fine; however, when I convert columns with carriage returns in
them, the row does not wrap inside Excel; instead, you end up with a very
long (verticle) column. Inside Excel, even columns/autofit selection has
not effect. The entire spreadsheet, therefore, looks distorted. Is there
any way to strip out chr(10) + chr(13) from the data?

Thanks for any help.

Bernie Yaeger


Nov 20 '05 #1
4 1274
Cor
Hi Bernie,

When you look down about 20 rows in this newgroup you see a question from
Able almost like this,

I found it funny because a lot of people where answering on that.

Armin gives as extra the answer you need complete. (with the vbcrlf)
(I would take that one, mine was just a completely alternative method from
the earlier posters and I posted the same time as Armin)

If you cannot find it, I can give you of course the answer, but there are so
much possibilities in this message and answers.

By the way, if it is than still not working have than also a look at the
"HT" "09" and "Lf" "13" because as far as I remember me, Cindy once told in
this newsgroup that that was used with Excel.

I hope this works.

Cor
Nov 20 '05 #2
Hi Cor,

I've looked 60 down and in different sort orders but can find no other
question like mine. Can you give me some more info on that message?

Tx,

Bernie

"Cor" <no*@non.com> wrote in message
news:ek****************@TK2MSFTNGP12.phx.gbl...
Hi Bernie,

When you look down about 20 rows in this newgroup you see a question from
Able almost like this,

I found it funny because a lot of people where answering on that.

Armin gives as extra the answer you need complete. (with the vbcrlf)
(I would take that one, mine was just a completely alternative method from
the earlier posters and I posted the same time as Armin)

If you cannot find it, I can give you of course the answer, but there are so much possibilities in this message and answers.

By the way, if it is than still not working have than also a look at the
"HT" "09" and "Lf" "13" because as far as I remember me, Cindy once told in this newsgroup that that was used with Excel.

I hope this works.

Cor

Nov 20 '05 #3
Cor
Hi Bernie,

Here is the link on Google, saves time

http://www.google.com/gr******************************@news2.e.nsc.no

If it is not what you ment, tell me, but I am almost sure of it.

Cor
Nov 20 '05 #4
Hi Cor,

Yes, that is exactly what I needed! Tx.

Bernie

"Cor" <no*@non.com> wrote in message
news:eu****************@TK2MSFTNGP10.phx.gbl...
Hi Bernie,

Here is the link on Google, saves time

http://www.google.com/gr******************************@news2.e.nsc.no

If it is not what you ment, tell me, but I am almost sure of it.

Cor

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35484
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
20272
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
1
2399
by: st | last post by:
Hi, I've a routine that exports a DB query to Excel by building an XmlDocument and saving to a XmlTextWriter. I'm having trouble with carriage returns in a mailing address not showing up in the...
5
8925
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
0
1663
by: Bryan Ax | last post by:
I'm trying to fix a bug in someone else's code. He's got a string saved in a database such as: <xsl:variable name="Var1"> <xsl:choose> <xsl:when test="@SomeAttribute &gt; 1'"> <xsl:value-of...
3
4102
by: JohnM | last post by:
I can transfer from a query with DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Filenam", CPath, True I would like to use a form for the user to select and order data then...
21
1976
by: py_genetic | last post by:
Hello, I'm importing large text files of data using csv. I would like to add some more auto sensing abilities. I'm considing sampling the data file and doing some fuzzy logic scoring on the...
1
1979
by: =?Utf-8?B?Sm9XaWxsbW90dA==?= | last post by:
I have data that I would like to store in an excel spreadsheet. It's currently in a Word table. The problem is that each line has some cells that split over several lines. If I copy and paste it as...
1
10672
by: jollyroger | last post by:
I have searched the web forums, and can't seem to find an answer to this particular problem I have. In an excel sheet, cells in one column have formatted text in the "wrapped" cells. For many of...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.