Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Controls Array

Can you have an Array of Controls that are located in different Frames on a
UserForm? Here is the code that I have and I am getting an Run Time Error:
Type Mismatch.

For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
"cboSingle", "cboDouble",
"cboDebossed"))
With Control
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next Control
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Controls Array

Can you have an Array of Controls that are located in different Frames on
a
UserForm? Here is the code that I have and I am getting an Run Time
Error:
Type Mismatch.

For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
"cboSingle", "cboDouble",
"cboDebossed"))
With Control
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next Control


Try your For Each statement this way and see if that works...

For Each Control In Array(cboAreaP, cboAreaV, cboAreaD, _
cboSingle, cboDouble, cboDebossed)

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Controls Array

Try something like this.......on UserForm code sheet

For Each C In Array("cboAreaP", "cboAreaV", "cboAreaD", "cboSingle",
"cboDouble", "cboSingle", "cboDouble","cboDebossed")
With Me.Controls(C)
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next

--

Regards,
Nigel




"RyanH" wrote in message
...
Can you have an Array of Controls that are located in different Frames on
a
UserForm? Here is the code that I have and I am getting an Run Time
Error:
Type Mismatch.

For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
"cboSingle", "cboDouble",
"cboDebossed"))
With Control
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next Control


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
Inserting Values in a Multidimensional Array from Two Different Controls shivboy[_3_] Excel Programming 2 June 8th 06 10:13 PM
array of userform controls Doug Glancy Excel Programming 3 June 5th 05 10:37 AM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
renaming array of controls Jason[_31_] Excel Programming 1 July 1st 04 04:32 AM
excel VBA set array controls Jason[_31_] Excel Programming 1 June 30th 04 11:38 PM


All times are GMT +1. The time now is 08:10 PM.

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

About Us

"It's about Microsoft Excel"