Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting number format of string value to excel - Datagridview

Status
Not open for further replies.

gutenjuni

Programmer
Mar 20, 2008
4
0
0
Hello.

I have a program that shows product data on the datagridview. And there is column called serial number. Some of them contains only numbers such as 129905967620. In that case if I copy it to excel it shows like this "1.29906E+11".

The format of the column is string.

But it shows in that way.

Can anyone help me to correct this, please?

 
How are you copying to Excel? I have code that creates a workbook and pastes data int a worksheet. I then select a range in the worksheet and format numeric data with something like this:

oSheet.cells.numberformat = "#,##0.00"

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top