Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default renaming array of controls

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?




  #2   Report Post  
Posted to microsoft.public.excel.programming
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?






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
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
excel VBA set array controls Jason[_31_] Excel Programming 1 June 30th 04 11:38 PM
Renaming ianripping[_66_] Excel Programming 3 May 22nd 04 12:02 PM
Renaming within VBA Brent McIntyre Excel Programming 4 August 21st 03 02:10 AM


All times are GMT +1. The time now is 04:38 PM.

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"