View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default looping through userform controls changing enabled and locked properties

This will switch the state of the control as you required, incorporate this
into your control loop to act on each control.

Private Sub CommandButton1_Click()
With TextBox1
If .Enabled Then
.Enabled = False
.Locked = True
Else
.Enabled = True
.Locked = False
End If
End With
End Sub

Cheers
Nigel

"JulieD" wrote in message
...
Hi All

i'm trying to (Excel 2000) loop through userform controls which are set to
enabled = false & locked = true to change them to enabled = true and

locked
= false on the On Click of a command button.

I have John Walkenbach's book (excel 2002) where he shows code for looping
through controls but i can't seem to find a way to get to either the

enabled
or locked properties - everything i tried resulted in excel crashing !

Help!

Thanks
JulieD