Attribute Issues

Pestomania

Board Regular
Joined
May 30, 2018
Messages
108
Hi! Whenever I dim an attribute to "shape" it makes it captialize weird. Say I type "dim shp as shape" it returns this "Dim shp as sHape"

Anyone know why it would capitalize the "H"?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,909
Office Version
365
Platform
Windows
It sound like at some point you have used sHape as a variable, or the name of a procedure.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,726
Office Version
2010
Platform
Windows
Add this line to any module and then delete it:

Code:
Dim Shape
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,726
Office Version
2010
Platform
Windows
To amplify: In VBA, the last declaration of a variable sets the capitalization for all variables, procedures, objects, properties, methods, and enumerations of the same name project-wide. “Last declaration” includes declarations in the signature of procedures, e.g.,

Code:
Function myFunc(bob As String) As Variant
As a result, it’s impossible to have in the same project a variable, object, property, method, or enumeration named Bob and another named bob.

So if you see

Code:
ActiveWorkbook.name
just enter and delete one line anywhere in the project:

Code:
Dim Name
It will change the case of all appearances of the word project-wide.
 
Last edited:

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,726
Office Version
2010
Platform
Windows
You're welcome.
 

Forum statistics

Threads
1,085,986
Messages
5,387,110
Members
402,042
Latest member
snowballresource02

Some videos you may like

This Week's Hot Topics

Top