View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default looping through userform controls changing enabled and locked properties

Julie,

Here is an example

Dim ctl As msforms.Control

For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If ctl.Enabled Then
MsgBox ctl.Name
End If
End If
Next ctl

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"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