问题
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
- You have named one of the modules as
value
- You have a variable called
value
in one of your procedures/functions - 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