View Full Version : Solved: Disable Cmd Button
av8tordude
04-26-2009, 08:14 AM
I have a command button in a worksheet. If I select a cell that is not in Column A, I would like to disable the command button. Can someone assist me with this objective. Thanks in advance.
mikerickson
04-26-2009, 08:31 AM
If the button is from the Forms menu, this should work.Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
With Target
ActiveSheet.Shapes("Button 1").OLEFormat.Object.Enabled = (.Column * .Columns.Count = 1)
End With
End Sub
av8tordude
04-26-2009, 08:36 AM
Thank you mikerickson
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.