Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop thru objects 1

Status
Not open for further replies.

rgandy

Technical User
Joined
Nov 17, 2005
Messages
38
Location
US
hi all,
what is the syntax for looping thru all checkboxes, dropdownlists, etc on a worksheet to change their locked property? (i want them to be unlocked?

i tried the following

for each checklock in oleobjects
checklock.locked = false
next checklock

returned a type mismatch...please let me know thanks!
 
Try this:
Code:
Sub LoopWorksheetControls()
Dim oCtrl As OLEObject

   With ActiveSheet
     For Each oCtrl In .OLEObjects
       oCtrl.Locked = True
     Next oCtrl
   End With
   
End Sub


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top