为什么在Excel VBA中将“行"更改为“行" [英] Why 'Row' changes to 'row' in Excel VBA

查看:100
本文介绍了为什么在Excel VBA中将“行"更改为“行"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于未知原因,我的Excel VBA编辑器发生了更改:
Cells(ActiveCell.Row, 1).Value = MyString
进入
Cells(ActiveCell.row, 1).Value = MyString

For unknow reason my Excel VBA editor changes:
Cells(ActiveCell.Row, 1).Value = MyString
into
Cells(ActiveCell.row, 1).Value = MyString

单词"Row"应以大写字母"R"开头,但键入后,它会变为小写的"r".我已经检查了代码,并且确定不会将"raw"用作变量.宏本身可以正常工作,就像它被写为行"一样.在其他工作簿上,一切正常(R大写).

Word "Row" should start with capital "R" but after I type it, it changes to small "r". I have checked the code and I am sure I do not use "raw" as a variable. The macro itself works fine as if it was written "Row". On other workbooks everything is ok (R is capitalized).

有人知道为什么会发生吗?

Anybody has idea why it happens?

推荐答案

我在该工作表的VBA中使用了变量row.然后,我将变量row的名称更改为MyRowName之类的名称.尽管在VBA中不再存在诸如row这样的变量,但该单词仍保留为小写.正如我上面提到的,一切正常,即ActiveCell.row返回了ActiveCell.Row应有的状态.

I used variable row in VBA of that worksheet. Then I changed the name of the variable row to something else like MyRowName Although there was no such variable as row in VBA anymore, it still kept lower case for that word. As I mentioned above everything worked fine i.e. ActiveCell.row returned what it should for ActiveCell.Row.

出于审美原因,我将整个VBA复制到了另一个工作表中,该错误已得到解决.该行返回大写字母.

For just aesthetic reasons, I have copied the whole VBA to another worksheet and the bug was crunched. Row returned to Upper case.

这篇关于为什么在Excel VBA中将“行"更改为“行"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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