Attribute Issues

Pestomania

Board Regular
Joined
May 30, 2018
Messages
152
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"?
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,543
Office Version
  1. 365
Platform
  1. 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,783
Office Version
  1. 2010
Platform
  1. Windows
Add this line to any module and then delete it:

Code:
Dim Shape
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,783
Office Version
  1. 2010
Platform
  1. 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,783
Office Version
  1. 2010
Platform
  1. Windows
You're welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,567
Messages
5,625,550
Members
416,116
Latest member
Joemamasuka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top