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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with For Each... Next Statement.

Status
Not open for further replies.

SQLBI

IS-IT--Management
Jul 25, 2003
988
GB
Hi,

Having trouble with the following code. I know it'll be something really simple but can i find it...?

Code:
Public Sub SetSpinButtons()

    For Each SpinButton In Sheet1
    
        If SpinButton.Enabled = False Then
        
            SpinButton.Enabled = True
    
        End If
        
    Next

End Sub

Thanks in advance.

Leigh Moore
LJM Analysis Ltd
 
If you use toolbox controls, this will toggle 'enabled' property of all spinbuttons on sheet1:
[tt]Dim olo As OLEObject
For Each olo In Sheet1.OLEObjects
If olo.progID = "Forms.SpinButton.1" Then
olo_Object.Enabled = Not olo_Object.Enabled
End If
Next[/tt]

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top