Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Naming UserForm CommandButtons using VBA

This is slightly different than something I asked yesterday. Unfortunately,
applying yesterday's solution method does not work for this.
I'm trying to name a series of command buttons on a UserForm. Can you use
code to name commandbuttons on a Userform? This is what I got which doesn't
work.


For i = 1 To 37
c = 38

UserForm3.Controls("CommandButton" & i).Name = "M" & c

c = c + 1
Next i


Thanks,
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Naming UserForm CommandButtons using VBA

No you didn't, you asked how to set the caption. You cannot set the name
property at runtime, just like the error message told you.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"PCLIVE" wrote in message
...
This is slightly different than something I asked yesterday.
Unfortunately, applying yesterday's solution method does not work for
this.
I'm trying to name a series of command buttons on a UserForm. Can you use
code to name commandbuttons on a Userform? This is what I got which
doesn't work.


For i = 1 To 37
c = 38

UserForm3.Controls("CommandButton" & i).Name = "M" & c

c = c + 1
Next i


Thanks,
Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Naming UserForm CommandButtons using VBA

Thanks Bob,

I wasn't saying that this was the same question, which as you pointed out
was dealing with setting the Caption properties. Your suggested solution
yesterday was dead-on and helped me accomplish exactly what I wanted.. But
I trying something different today, but still dealing with the UserForm
CommandButton Properties. Anyway, I had a feeling that this one couldn't be
done.

As always, thanks for your help.
Paul

"Bob Phillips" wrote in message
...
No you didn't, you asked how to set the caption. You cannot set the name
property at runtime, just like the error message told you.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"PCLIVE" wrote in message
...
This is slightly different than something I asked yesterday.
Unfortunately, applying yesterday's solution method does not work for
this.
I'm trying to name a series of command buttons on a UserForm. Can you
use code to name commandbuttons on a Userform? This is what I got which
doesn't work.


For i = 1 To 37
c = 38

UserForm3.Controls("CommandButton" & i).Name = "M" & c

c = c + 1
Next i


Thanks,
Paul






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming command buttons on a UserForm Casey[_65_] Excel Programming 3 April 7th 06 04:47 PM
CommandButtons Mats Samson Excel Programming 4 January 17th 06 02:19 PM
Using For/Next Loop To Generate 4 CommandButtons On A UserForm Results In A Runtime Error 91 Donna[_7_] Excel Programming 4 February 28th 05 01:21 PM
Naming buttons in Userform on the fly Richard Excel Programming 1 May 17th 04 08:57 AM
Commandbuttons PCOR Excel Programming 1 May 11th 04 11:21 PM


All times are GMT +1. The time now is 07:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"