I like to enable/disable a command button in User Form with certain condition. I have worksheets like "ALL", "ALLA", "BARB" etc. I wrote the following code User Form Code window but it does not work. Please help me.
Regards
Bidyut
Codes I wrote :
![]()
Private Sub UserForm_load() With Worksheets("ALL") If WorksheetFunction.CountIf(Range("E2:E10000"), "ALLA") = 0 Then CommandButton1.Enabled = False Else CommandButton1.Enabled = True End If End With End Sub
Bookmarks