LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Control array problem

I haven't used control arrays before and am having trouble with setting
up and using them on a userform.

I have

Private Sub UserForm_Click()

End Sub

Private Sub UserForm_Initialize()
TextBox1(0).Visible = True
For i = 1 To 5
Load TextBox1(i)
TextBox1(i).Text = "A"
TextBox1(i).Visible = True
TextBox1(i).Left = TextBox1(i - 1).Left + 30
Next i

TextBox1(0).SetFocus

End Sub

as the code for userform1 and a module

Sub test()

UserForm1.Show

End Sub


On the userform, I have set the Tabindex for textbox1 to 0.

When I run this, I get a Runtime error 13: Type Mismatch error.

Could someone tell me what is causing this please?

Also, is TextBox1(0).SetFocus ok to set the focus on the first textbox?

Thanks
Chris
 
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
Help with Control Array Sum Formula Jim May Excel Discussion (Misc queries) 12 October 26th 06 11:03 AM
Control Array Help... excel_slave - ExcelForums.com Excel Programming 3 August 10th 05 01:19 PM
Problem: Control Toolbox Control resizes when clicked Ed Excel Programming 1 July 27th 05 07:55 AM
Creating a Control Array imrylin Excel Programming 4 March 3rd 05 04:35 AM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM


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