This is a discussion on Disabling buttons on worksheets using vba within the Excel Questions forums, part of the Question Forums category; Hi there, Can anyone help me I wish to disable some buttons on a worksheet so to guide the user ...
Can anyone help me I wish to disable some buttons on a worksheet so to guide the user around the page step by step can anyone help me with the referencing of the button
i.e Worksheet("Main Menu").cmdButton.enabled = False
The correct code would be :
where NumberHere represents the actual CommandButton number.Code:Sheets("Main Menu").CommandButton
.Enabled = False
You can also loop through the controls and disable all those command buttons that are not named "Whatever" using the CmdButton control type i.e
Try ThatCode:For Each ctl in Controls If ctl.Type = CmdButton Then If ctl.Name <> CommandButton1 Then ctl.Enabled = False End If End If Next ctl