Excel VBA editor auto-UNcapitalizing properties

2019-07-20 01:30发布

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条回答
ら.Afraid
2楼-- · 2019-07-20 02:23

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

enter image description here

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
查看更多
登录 后发表回答