View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default renaming array of controls

I would assume that if the property cannot be set at runtime, there is no
way of doing it.

If you are just trying to effect a mass change, you can do it at design-time
using the syntax:

ThisWorkbook.VBProject.VBComponents("UserForm1").D esigner _
..Controls("CommandButton1").Name = "MyCmb1"

and looping through the collection.

--

Vasant

"Jason" wrote in message
...
from the default CommandButton1,2,3........100.

to

MyCmb1,2,3.....100


I tried

Dim x As Single
For x = 1 To 100
Controls("CommandButton" & x).Name = "MyCmb" & x
Next x

error "Can't set at runtime"

how else can I quickly change these?