Results 1 to 13 of 13

[SOLVED] making a checkbox appear and disappear based on a cell's value

Threaded View

  1. #12
    Registered User
    Join Date
    05-12-2021
    Location
    México
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (16.0.13530.20054)
    Posts
    17

    Unhappy Re: [SOLVED] making a checkbox appear and disappear based on a cell's value

    Dear Community:

    I'm new at coding and I'm trying to do the same as the initial thread. But for some reason I'm getting this error

    Run-time error '424'
    Object required


    I'm attaching the workbook that I'm trying to use.
    By default, the cell G8 has a value of "Please select the Probability". After we click the command button "Calculate Probability", a form pops up, we need to provide answers to the questionnaire and click on the button "Calculate".
    With the button, a calculation begins and the results affects the content of cell G8 and it triggers the CheckBox to be enabled. The condition to enable the CheckBox is that the content of the G8 cell must be different from "Please select the Probability".

    Here is the code:

    Private Sub cmdCalcProb_Click()

    With Worksheets("Data")
    .Range("C1:C12").ClearContents
    End With

    With Worksheets("Probability+Impact")
    If .Range("G8").Value = "Please select the Probability" Then
    .CheckBox1.Enabled = False
    .CheckBox1.Value = False
    Else
    .CheckBox1.Enabled = True
    End If
    End With

    Probability.Show

    End Sub


    Highlighted is the line where I get the error.
    Hope someone could help me, please
    Attached Files Attached Files
    Last edited by Magmarinita; 05-12-2021 at 10:59 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1