输入'='作为单元格中的第一个字符 [英] Entering '=' as the first character in a cell
问题描述
现在我将=替换为IS作为quickfix,但是如果我能保持等号,我希望与使用诸如<>之类的符号的单元一致。当我尝试,Excel认为它是一个错误的语法的函数。我使用 Cells(row,col).Value = x
,其中 x
是可能或不可能的字符串以=开始,输入数据。
添加单引号'
在字符串的开头:
Cells(row,col).Value ='& x
,你会得到你想要的。
I have a VBA macro that runs and often needs to have "=" as the first character in a cell. Cells are filled with such values as "= Domestic", "<> Domestic", etc.
Right now I am replacing "=" with "IS" as a quickfix, but I would like it if I could keep the equal sign, for consistency with cells that use symbols such as "<>". When I try, Excel thinks it is a function with the wrong syntax. I am using Cells(row, col).Value = x
, where x
is the string that may or may not start with "=", to enter the data.
Add a single quote '
at the start of the string:
Cells(row, col).Value = "'" & x
and you will get what you want.
这篇关于输入'='作为单元格中的第一个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!