Click here to Skip to main content
15,898,887 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an application that when I click Run Report the data will be generated and exported to excel.
I posted a question already for this.
My first problem is that I have a data in a column Requisition No. which is the value is for example like this 08-20 but when I export it on excel it will became a date like '20-Aug'
So I put a single quote in my code for it to identify as text and not convert to date.

If arrColumn(intColCount2) = 29 Then
    strHTML += "<td>‘" & dr("vRequisition") & "</td>"
End If


but now it shows like this in excel '08-20

I get the output that I want for my first problem.

What I have tried:

what I'm trying to do is to hide the single quote (') at the beginning of the text in excel so that it will show like this

08-20

is it possible to hide the single quote (') in the beginning of the text in excel?
Posted
Updated 13-Mar-17 0:25am
v2

See my solution to your earlier question How to get the exact value from website to excel?[^]

The character showing in your code is not a single quote (Ascii 39)
 
Share this answer
 
The default for cells is General format which means Excel looks at the data in the cell and tries to determine how best to display it.

The easiest method is to set the column to Text, that way you do not need a prefix on numbers to force display as string.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900