[RESOLVED] Excel numberformat !?
i am transferring data from a vb.net datagridview control to a new instance
of excel (early binding)
here i am creating a excel instance
vb.net Code:
Dim Exl_App As New Microsoft.Office.Interop.Excel.Application
Dim Exl_Wbook As Workbook
Exl_Wbook = Exl_App.Workbooks.Add
Dim Exl_Sheet As Worksheet
Dim ExL_Sheet2 As Worksheet
here i am formatting the cells & transferring data
vb.net Code:
.Range("e1:e65000").Cells.NumberFormat = "Text"
.Range("g1:g65000").Cells.NumberFormat = "Text"
.Range("h1:h65000").Cells.NumberFormat = "Text"
.Range("i1:i65000").Cells.NumberFormat = "Text"
but the out put in the excel file is (please refer to the attachment sheet2)
the date type data out put is appearing like
Code:
T2011xt
T2011xt
T2011xt
what is wrong i am doing here please
Re: Excel numberformat !?
Quote:
Originally Posted by
make me rain
but the out put in the excel file is (please refer to the attachment sheet2)
What attachment?
I assume you are trying to fomat the cells for text format, you want:
"@"
Instead of "Text"
Re: Excel numberformat !?
thank you every One
your advise solved the issue.
i have changed the code as fallows
vb Code:
.Range("e1:e65000").Cells.NumberFormat = "@"
.Range("i1:i65000").Cells.NumberFormat = "@"
& it works
Re: [RESOLVED] Excel numberformat !?
if you don't mind please post other types of cell number formats also please
or else any link for that
Re: [RESOLVED] Excel numberformat !?
If I find one I'll post it. For that I found it easier to just use the macro recorder and look at it's code.
Re: [RESOLVED] Excel numberformat !?