i have a userform with 60 commandbuttons and need some code to loop through them all, making the ones without captions set to ..visible=false can't seem to get variables defined properly. any assistance greatly apprecieted =)
Try: Private Sub UserForm_Click() Dim O As Object For Each O In UserForm1.Controls If O.Caption = "" Then O.Visible = False End If Next End Sub -- Rod Gill Project MVP Visit www.msproject-systems.com for Project Companion Tools and more "diddi" wrote in message news:1138756019.652228.213440@o13g2000cwo.googlegroups.com... >i have a userform with 60 commandbuttons and need some code to loop > through them all, making the ones without captions set to > .visible=false > can't seem to get variables defined properly. > > any assistance greatly apprecieted =) >