View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
.Net .Net is offline
external usenet poster
 
Posts: 1
Default How do I set Excel cell format to "Text" from VB.NET?

I'm looking for a code that I could use to format an excel cell dynamically
for an card account number field type with more than 15 digits.

Here is the scenario.

Column name: Card Account
Card account number: xxxxxxxxxxxxxxxx

I cannot format the cells as number so I have to format as text. However,
when I run the process with the VBA code that I have telling to format as
text (@) it gives me this result in scientific notation because of the
length, I think.
Here is the VBA .NET code:
Select Case sFieldType
Case "Text"
objWorksheet.Range(objWorksheet.Cells(2, i + 1),
objWorksheet.Cells(CStr(mlRecordCount), i + 1)).NumberFormat = "@"

I just need to display the acc. number as is...can someone please help me!
I gladly appreciatted,
Sincerely,
Marlei Taylor