Thread: Control Array
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Control Array

Roger,

This works from a command button on a userform and the code loops through
all the controls and if they are labels you can format them.

Private Sub CommandButton1_Click()
Dim cCont As Control
For Each cCont In UserForm1.Controls
If TypeName(cCont) = "Label" Then
With cCont
'Your formatting code goes here
End With
End If
Next cCont
End Sub

Mike

"Roger" wrote:

I have to re format several Labels on a Userform - I only know how to format
them 1 at a time - could someone show me example code for formatting several
Labels at the same time in an array. Thankyou in anticipation