Form Command Button Problem..

D

Don

Hi All,

Developing a UserForm with CommandButtons, one for each week of the year. I
first inserted CB's (1-13) in a row representing the first Qtr of the year,
then copied and pasted this column across the Form. In the process of moving
the rows of buttons to their respective spot, I didn't keep them in order and
had to rename them to keep some order in the form.

Problem....when I got to the fourth column of CB's, the first one should be
labeled CommandButton40 but I got the "Could not set the Name property.
Ambiguous Name.".....then tried the number 41 with the same results until I
got to the number 53, which the form allowed. There are no other buttons on
this form, and in looking through the dropdown at the top of the properties
window, there are no CommandButtons 40 thru 52 listed, so I'm not sure why
I'm getting this error msg.

One thought just came to mind...I did paste one too many rows of buttons,
and deleted one of these rows. These may have been numbered 40-52. So, for
a test, I opened a new sheet and tried to duplicate the error......made a row
of CommandButtons (1-4), copied and pasted that row twice, ending up with two
more columns of buttons numbering (5-8 & 9-12). I deleted the middle row
(5-8) and then renamed (9-12) to (5-8).....the new names were accepted with
no problem. It would appear that the deleteing of the row in my original
form is not the problem.

Any help explaining this would be greatly appreciated.

TIA,

Don
 
J

Jim Jackson

I have not been able to determine what caused the problem but if you give
each button a unique name such as 'wk1, wk2' etc that might avoid problems
and still allow you to have recognizable names for each button.

Just a thought.

Jim
 
D

Don

Thanks for looking Jim,

I did rename the button to CmdBn40 and that was accepted but as far as I can
tell "CommandButton40" was and is a unique name, but I still get the same
error msg trying to use it. Bottom line is the form works fine, just can't
use CommandButton40 thru 52.

Ahhhhh the mysteries of Excel.....lol

Have a great weekend,

Don
 
J

Jim Jackson

Thanks, Don. I hope your weekend proves to give you needed rest and
re-energizing.

Jim
 

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