I have a gridview export to .csv file. When I export data, if there is a value like 10-10 and it open in excel it is shown as "10-oct". What do I do to get it to show up as "10-10"?
7 Answers
Similar to what Austin suggests, you can prepend the value with a single quote (') which escapes automatic formatting and treats the contests as TEXT:
1,3,'10-10,a
As noted in the comments though, this solution works in some programs, but not all versions of excel. If this is extremely important, you may need to consider exporting directly to .xls or some other rich format.
1 Comment
Austin Salonen
I'll give you an upvote but with this note: on Excel 2003 this displayed the
' and that may not be with the OP wants.