如何在excel中的文本开头隐藏单引号(')? [英] How to hide single quote (') in the beginning of a text in excel?

查看:906
本文介绍了如何在excel中的文本开头隐藏单引号(')?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,当我点击运行报告时,数据将被生成并导出到Excel。

我已经为此发布了一个问题。

我的第一个问题是我在列申请编号中有一个数据,例如这个值就像这个08-20,但当我在excel上导出它时,它将变成像'20 -Aug'的日期

所以我在我的代码中添加了一个引号,用于标识文本而不是转换为日期。



如果是arrColumn(intColCount2) = 29然后
strHTML + =< td>'&博士(vRequisition)& < / TD> 中
结束如果





但现在它在excel '08 -20中显示如下



我得到了我想要的第一个问题的输出。



我尝试了什么:



我想要做的是隐藏excel中文本开头的单引号('),这样它就会显示为



08-20



是否可以隐藏excel中文本开头的单引号(')? div class =h2_lin>解决方案

查看我之前问题的解决方案如何从网站获得精确值?excel? [ ^ ]



代码中显示的字符不是单引号(Ascii 39)


单元格的默认值是通用格式,这意味着Excel会查看单元格中的数据,并尝试确定如何最佳地显示它。



最简单的方法是将列设置为Text,这样就不需要在数字上添加前缀来强制显示为字符串。


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?

解决方案

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)


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.


这篇关于如何在excel中的文本开头隐藏单引号(')?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆