Excel VBA editor auto-UNcapitalizing properties

橙三吉。 提交于 2019-12-12 18:28:49

问题


Usually the Excel VBA editor auto-capitalizes keywords and property names for you, but now it is un-capitalizing them. Like this:

Private Sub CommandButton1_Click()
    Range("A1").Value = "test"
End Sub

changes to:

Private Sub CommandButton1_Click()
    Range("A1").value = "test"
End Sub

And then the code doesn't run properly. Any ideas what could cause this behavior? Thanks.


回答1:


Possible reasons

  1. You have named one of the modules as value
  2. You have a variable called value in one of your procedures/functions
  3. You have a procedure/function with that name

Example for point 1

Example for point 2

Sub Sample()
    Range("A1").value = "Sid"
End Sub

Sub Blah()
    Dim value As Long

    value = 1
End Sub

Example for point 3

Sub Sample()
    Range("A1").value = "Sid"
End Sub

Sub value()
    '
    '
    '
End Sub


来源:https://stackoverflow.com/questions/26796877/excel-vba-editor-auto-uncapitalizing-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!