LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default How to loop through controls on a MultiPage

"On final approach"...

Sub Test()
Dim x As MSForms.Control

For Each x In UserForm1.Frame1.Controls
If TypeOf x Is MSForms.Label Then
If x.Caption = "Label1" Then
MsgBox "Label1 height is " & x.Height
Else
MsgBox "Caption is not Label1"
End If

ElseIf TypeOf x Is MSForms.ComboBox Then
If x.Name = "ComboBox1" Then
MsgBox "ComboBox1"
Else
MsgBox "Not ComboBox1"
End If

ElseIf TypeOf x is...

End If
Next

End Sub


"42N83W" wrote in message
...
Still getting a type mismatch in the FOR statement.

This worked, but only because my labels weren't blank:

For i = 0 To fra02_01.Controls.Count - 1
If fra02_01.Controls.Item(i) = "" Then
' do stuff
Exit Sub
End If
Next i


-gk-


 
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
Multipage Controls - Experts Only Dee Veloper[_2_] Excel Programming 1 January 25th 05 11:57 PM
Progmatically adding controls in multipage Ajit Excel Programming 0 January 4th 05 09:39 PM
Multipage & Spinbutton controls on a form Bhuktar S Excel Programming 1 April 21st 04 01:50 PM
Events for Controls in a Multipage Control George[_18_] Excel Programming 4 February 18th 04 05:56 PM
Scrollable list box demo now handles multipage controls Robin Hammond Excel Programming 0 October 8th 03 03:24 AM


All times are GMT +1. The time now is 11:49 AM.

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"