Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Can any controls name concatenated?

If you know the names and the number of textboxes:

Option Explicit
Private Sub UserForm_Initialize()
Dim iCtr As Long
For iCtr = 1 To 10
Me.Controls("Txtbox" & iCtr).Value = "all the same"
Next iCtr
End Sub




Richard wrote:

Hi,

Hope someone can help me with this.

Here is the Example that I'm trying to do.

Example
assume there is the text box controls such as txtbox1, txtbox2, txtbox3,
txtbox4, txtbox5, etc...

Private Sub UserForm_Initialize()

Dim ctrTextbox As Controls

For i = 1 To 10

ctrTextbox = "txtbox" & i
Me.ctrTextbox = "All text box have same value"

Next i

End Sub

With above coding, I'm getting Complie error: "Argument not optional"

Any help will be appreciated.

Thanks


--

Dave Peterson
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
concatenated lookup? BorisS Excel Worksheet Functions 7 December 13th 06 06:57 PM
appearance of a concatenated value Jan Buckley Excel Worksheet Functions 0 November 15th 06 09:29 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
Separate Concatenated First/Last Name Al Excel Programming 2 October 20th 04 07:41 PM


All times are GMT +1. The time now is 08:25 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"