Closed Thread
Results 1 to 13 of 13

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

Hybrid View

Guest [SOLVED] making a checkbox... 01-23-2006, 11:30 AM
Guest RE: making a checkbox appear... 01-23-2006, 03:10 PM
Guest Re: making a checkbox appear... 01-23-2006, 04:30 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:30 PM
Guest Re: making a checkbox appear... 01-23-2006, 08:10 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:35 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:55 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:55 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:55 PM
Guest Re: making a checkbox appear... 01-23-2006, 05:55 PM
Guest RE: making a checkbox appear... 01-23-2006, 03:10 PM
Magmarinita Re: [SOLVED] making a... 05-12-2021, 10:56 PM
AliGW Re: [SOLVED] making a... 05-12-2021, 11:36 PM
  1. #1
    Peter T
    Guest

    Re: making a checkbox appear and disappear based on a cell's value

    A typo in your original code continued into Jim's

    > Private Sub Worksheets_Calculate()


    Private Sub Worksheet_Calculate()


    When you say "Changing the cell's value" if the cell is not a formula
    changing it's value will not trigger a calculation event. So use the Change
    event

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("a1")) Is Nothing Then
    CheckBox1.Visible = UCase(Range("A1") = "ABC")
    End If

    End Sub

    As the code is in a worksheet module everything defaults to the sheet, even
    if it's not the active sheet. For clarity could qualify with Me

    Regards,
    Peter T


    "yoram" <yoramsk@gmail.com> wrote in message
    news:1138048027.329955.318120@g14g2000cwa.googlegroups.com...
    > Thanks for the prompt response. Unfortunately, the code still doesn't
    > work for me. Changing the cell's value doesn't make the checkbox
    > visibile/invisible. I am running 2002 and tried with protection on/off.
    >




  2. #2
    Peter T
    Guest

    Re: making a checkbox appear and disappear based on a cell's value

    Obviously one of those typo days -

    > CheckBox1.Visible = UCase(Range("A1") = "ABC")


    CheckBox1.Visible = UCase(Range("A1")) = "ABC"

    (assuming case sensitive condition is not required)

    Regards,
    Peter T

    "Peter T" <peter_t@discussions> wrote in message
    news:uVKuQNGIGHA.2040@TK2MSFTNGP14.phx.gbl...
    > A typo in your original code continued into Jim's
    >
    > > Private Sub Worksheets_Calculate()

    >
    > Private Sub Worksheet_Calculate()
    >
    >
    > When you say "Changing the cell's value" if the cell is not a formula
    > changing it's value will not trigger a calculation event. So use the

    Change
    > event
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    >
    > If Not Intersect(Target, Range("a1")) Is Nothing Then
    > CheckBox1.Visible = UCase(Range("A1") = "ABC")
    > End If
    >
    > End Sub
    >
    > As the code is in a worksheet module everything defaults to the sheet,

    even
    > if it's not the active sheet. For clarity could qualify with Me
    >
    > Regards,
    > Peter T
    >
    >
    > "yoram" <yoramsk@gmail.com> wrote in message
    > news:1138048027.329955.318120@g14g2000cwa.googlegroups.com...
    > > Thanks for the prompt response. Unfortunately, the code still doesn't
    > > work for me. Changing the cell's value doesn't make the checkbox
    > > visibile/invisible. I am running 2002 and tried with protection on/off.
    > >

    >
    >




Closed Thread

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