Command button naming issue

K

Ken Warthen

In an Excel 2007 workbook I have a worksheet with several command buttons on
it. I use somewhat wordy names for my command buttons, e.g.,
cmdEBITLessThanZeroGreaterThanNegativeOneHundred. I'm now having a problem
where the command button name is not saving properly. In edit view I can
double click on the command button and it will open the editor to the routine
for that button. I save the workbook, close it, and open it again. Now if I
double click on the command button in edit view it opens another routine
called cmdEBIT_Click with no code listed in the routine. This really has me
baffled. Is there a limit to the length of a command button name?

Ken
 
P

Peter T

Although it seems possible to give an ActiveX control a long name in
properties, the limit for Objects names in general is 31, eg sheets, shapes
etc. You couldn't say give a long name to the control in the Names box left
of the input bar.

Maybe a bit more economy in your naming, eg

cmdEBITLessThanZeroGreaterThanNegativeOneHundred
vs
cmdEBIT_0toNeg100
maybe with some other key to denote the less/more than's if really necessary

Don't forget you can always include additional info in the comments

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top