+ Reply to Thread
Results 1 to 9 of 9

Simple Checkbox Question

  1. #1
    teresa
    Guest

    Simple Checkbox Question

    Hi - this sort of works, however if the checkbox is ticked and I
    then change the value in K33, l6 doesnt change in tandem,
    I have to untick and then tick again - think an extra line is needed
    Thanks A Lot for any help

    Sub checkbox1_click()

    If CheckBox1.Value Then
    Range("l6") = Range("k33")
    Else
    Range("l6") = 0
    End If
    End Sub


  2. #2
    Bob Phillips
    Guest

    Re: Simple Checkbox Question

    Link the checkbox to a cell, and add a worksheet formula to test that linked
    cell.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "teresa" <[email protected]> wrote in message
    news:[email protected]...
    > Hi - this sort of works, however if the checkbox is ticked and I
    > then change the value in K33, l6 doesnt change in tandem,
    > I have to untick and then tick again - think an extra line is needed
    > Thanks A Lot for any help
    >
    > Sub checkbox1_click()
    >
    > If CheckBox1.Value Then
    > Range("l6") = Range("k33")
    > Else
    > Range("l6") = 0
    > End If
    > End Sub
    >




  3. #3
    teresa
    Guest

    Re: Simple Checkbox Question

    Sorry Bob - I didnt understand your response

    "Bob Phillips" wrote:

    > Link the checkbox to a cell, and add a worksheet formula to test that linked
    > cell.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "teresa" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi - this sort of works, however if the checkbox is ticked and I
    > > then change the value in K33, l6 doesnt change in tandem,
    > > I have to untick and then tick again - think an extra line is needed
    > > Thanks A Lot for any help
    > >
    > > Sub checkbox1_click()
    > >
    > > If CheckBox1.Value Then
    > > Range("l6") = Range("k33")
    > > Else
    > > Range("l6") = 0
    > > End If
    > > End Sub
    > >

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Simple Checkbox Question

    Hi Teresa,

    No worries, I often feel like that :-)

    Let's assume that it is a forms checkbox (tell me if not). Go to the
    checkbox and right-click it. Select the 'Format Control' menu option, and
    then the Control tab. In the Cell Link box, put a cell reference in there
    and OK out. If you check/uncheck the box, you will see it update your cell.

    Okay, let's assume that you linked to cell H1. In cell I6 add this formula

    =IF(H1=TRUE,K33,0)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "teresa" <[email protected]> wrote in message
    news:[email protected]...
    > Sorry Bob - I didnt understand your response
    >
    > "Bob Phillips" wrote:
    >
    > > Link the checkbox to a cell, and add a worksheet formula to test that

    linked
    > > cell.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "teresa" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi - this sort of works, however if the checkbox is ticked and I
    > > > then change the value in K33, l6 doesnt change in tandem,
    > > > I have to untick and then tick again - think an extra line is needed
    > > > Thanks A Lot for any help
    > > >
    > > > Sub checkbox1_click()
    > > >
    > > > If CheckBox1.Value Then
    > > > Range("l6") = Range("k33")
    > > > Else
    > > > Range("l6") = 0
    > > > End If
    > > > End Sub
    > > >

    > >
    > >
    > >




  5. #5
    Tom Ogilvy
    Guest

    Re: Simple Checkbox Question

    See my answer to your later posting of this question.

    --
    Regards,
    Tom Ogilvy

    "teresa" <[email protected]> wrote in message
    news:[email protected]...
    > Sorry Bob - I didnt understand your response
    >
    > "Bob Phillips" wrote:
    >
    > > Link the checkbox to a cell, and add a worksheet formula to test that

    linked
    > > cell.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "teresa" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi - this sort of works, however if the checkbox is ticked and I
    > > > then change the value in K33, l6 doesnt change in tandem,
    > > > I have to untick and then tick again - think an extra line is needed
    > > > Thanks A Lot for any help
    > > >
    > > > Sub checkbox1_click()
    > > >
    > > > If CheckBox1.Value Then
    > > > Range("l6") = Range("k33")
    > > > Else
    > > > Range("l6") = 0
    > > > End If
    > > > End Sub
    > > >

    > >
    > >
    > >




  6. #6
    Tom Ogilvy
    Guest

    Re: Simple Checkbox Question

    You might want to add that for your solution she should also eliminate the
    VBA code or the formula will be overwritten when the checkbox is unchecked.

    --
    Regards,
    Tom Ogilvy

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Hi Teresa,
    >
    > No worries, I often feel like that :-)
    >
    > Let's assume that it is a forms checkbox (tell me if not). Go to the
    > checkbox and right-click it. Select the 'Format Control' menu option, and
    > then the Control tab. In the Cell Link box, put a cell reference in there
    > and OK out. If you check/uncheck the box, you will see it update your

    cell.
    >
    > Okay, let's assume that you linked to cell H1. In cell I6 add this formula
    >
    > =IF(H1=TRUE,K33,0)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "teresa" <[email protected]> wrote in message
    > news:[email protected]...
    > > Sorry Bob - I didnt understand your response
    > >
    > > "Bob Phillips" wrote:
    > >
    > > > Link the checkbox to a cell, and add a worksheet formula to test that

    > linked
    > > > cell.
    > > >
    > > > --
    > > >
    > > > HTH
    > > >
    > > > RP
    > > > (remove nothere from the email address if mailing direct)
    > > >
    > > >
    > > > "teresa" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Hi - this sort of works, however if the checkbox is ticked and I
    > > > > then change the value in K33, l6 doesnt change in tandem,
    > > > > I have to untick and then tick again - think an extra line is needed
    > > > > Thanks A Lot for any help
    > > > >
    > > > > Sub checkbox1_click()
    > > > >
    > > > > If CheckBox1.Value Then
    > > > > Range("l6") = Range("k33")
    > > > > Else
    > > > > Range("l6") = 0
    > > > > End If
    > > > > End Sub
    > > > >
    > > >
    > > >
    > > >

    >
    >




  7. #7
    Bob Phillips
    Guest

    Re: Simple Checkbox Question

    Tom,

    I don't think I will bother, your solution is so much better.

    Bob


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > You might want to add that for your solution she should also eliminate the
    > VBA code or the formula will be overwritten when the checkbox is

    unchecked.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Hi Teresa,
    > >
    > > No worries, I often feel like that :-)
    > >
    > > Let's assume that it is a forms checkbox (tell me if not). Go to the
    > > checkbox and right-click it. Select the 'Format Control' menu option,

    and
    > > then the Control tab. In the Cell Link box, put a cell reference in

    there
    > > and OK out. If you check/uncheck the box, you will see it update your

    > cell.
    > >
    > > Okay, let's assume that you linked to cell H1. In cell I6 add this

    formula
    > >
    > > =IF(H1=TRUE,K33,0)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "teresa" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Sorry Bob - I didnt understand your response
    > > >
    > > > "Bob Phillips" wrote:
    > > >
    > > > > Link the checkbox to a cell, and add a worksheet formula to test

    that
    > > linked
    > > > > cell.
    > > > >
    > > > > --
    > > > >
    > > > > HTH
    > > > >
    > > > > RP
    > > > > (remove nothere from the email address if mailing direct)
    > > > >
    > > > >
    > > > > "teresa" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > Hi - this sort of works, however if the checkbox is ticked and I
    > > > > > then change the value in K33, l6 doesnt change in tandem,
    > > > > > I have to untick and then tick again - think an extra line is

    needed
    > > > > > Thanks A Lot for any help
    > > > > >
    > > > > > Sub checkbox1_click()
    > > > > >
    > > > > > If CheckBox1.Value Then
    > > > > > Range("l6") = Range("k33")
    > > > > > Else
    > > > > > Range("l6") = 0
    > > > > > End If
    > > > > > End Sub
    > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >

    >
    >




  8. #8
    Tom Ogilvy
    Guest

    Re: Simple Checkbox Question

    I wouldn't be so quick to discount your solution. In her lastest post, she
    wants to handle 20 checkboxes, so a none programming solution might be in
    order. I provided a link to Walkenbach's class approach, but based on past
    postings, I don't know if that will be an option.

    --
    Regards,
    Tom Ogilvy

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Tom,
    >
    > I don't think I will bother, your solution is so much better.
    >
    > Bob
    >
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:[email protected]...
    > > You might want to add that for your solution she should also eliminate

    the
    > > VBA code or the formula will be overwritten when the checkbox is

    > unchecked.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Bob Phillips" <[email protected]> wrote in message
    > > news:%[email protected]...
    > > > Hi Teresa,
    > > >
    > > > No worries, I often feel like that :-)
    > > >
    > > > Let's assume that it is a forms checkbox (tell me if not). Go to the
    > > > checkbox and right-click it. Select the 'Format Control' menu option,

    > and
    > > > then the Control tab. In the Cell Link box, put a cell reference in

    > there
    > > > and OK out. If you check/uncheck the box, you will see it update your

    > > cell.
    > > >
    > > > Okay, let's assume that you linked to cell H1. In cell I6 add this

    > formula
    > > >
    > > > =IF(H1=TRUE,K33,0)
    > > >
    > > > --
    > > >
    > > > HTH
    > > >
    > > > RP
    > > > (remove nothere from the email address if mailing direct)
    > > >
    > > >
    > > > "teresa" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Sorry Bob - I didnt understand your response
    > > > >
    > > > > "Bob Phillips" wrote:
    > > > >
    > > > > > Link the checkbox to a cell, and add a worksheet formula to test

    > that
    > > > linked
    > > > > > cell.
    > > > > >
    > > > > > --
    > > > > >
    > > > > > HTH
    > > > > >
    > > > > > RP
    > > > > > (remove nothere from the email address if mailing direct)
    > > > > >
    > > > > >
    > > > > > "teresa" <[email protected]> wrote in message
    > > > > > news:[email protected]...
    > > > > > > Hi - this sort of works, however if the checkbox is ticked and I
    > > > > > > then change the value in K33, l6 doesnt change in tandem,
    > > > > > > I have to untick and then tick again - think an extra line is

    > needed
    > > > > > > Thanks A Lot for any help
    > > > > > >
    > > > > > > Sub checkbox1_click()
    > > > > > >
    > > > > > > If CheckBox1.Value Then
    > > > > > > Range("l6") = Range("k33")
    > > > > > > Else
    > > > > > > Range("l6") = 0
    > > > > > > End If
    > > > > > > End Sub
    > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >

    > >
    > >

    >
    >




  9. #9
    Bob Phillips
    Guest

    Re: Simple Checkbox Question

    I think it should be, I thought the same about it. I think it is beyond
    Teresa's capabilities though, so I have given her some code adapted to WS
    checkboxes.

    Regards

    Bob


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > I wouldn't be so quick to discount your solution. In her lastest post,

    she
    > wants to handle 20 checkboxes, so a none programming solution might be in
    > order. I provided a link to Walkenbach's class approach, but based on

    past
    > postings, I don't know if that will be an option.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Tom,
    > >
    > > I don't think I will bother, your solution is so much better.
    > >
    > > Bob
    > >
    > >
    > > "Tom Ogilvy" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > You might want to add that for your solution she should also eliminate

    > the
    > > > VBA code or the formula will be overwritten when the checkbox is

    > > unchecked.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "Bob Phillips" <[email protected]> wrote in message
    > > > news:%[email protected]...
    > > > > Hi Teresa,
    > > > >
    > > > > No worries, I often feel like that :-)
    > > > >
    > > > > Let's assume that it is a forms checkbox (tell me if not). Go to the
    > > > > checkbox and right-click it. Select the 'Format Control' menu

    option,
    > > and
    > > > > then the Control tab. In the Cell Link box, put a cell reference in

    > > there
    > > > > and OK out. If you check/uncheck the box, you will see it update

    your
    > > > cell.
    > > > >
    > > > > Okay, let's assume that you linked to cell H1. In cell I6 add this

    > > formula
    > > > >
    > > > > =IF(H1=TRUE,K33,0)
    > > > >
    > > > > --
    > > > >
    > > > > HTH
    > > > >
    > > > > RP
    > > > > (remove nothere from the email address if mailing direct)
    > > > >
    > > > >
    > > > > "teresa" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > Sorry Bob - I didnt understand your response
    > > > > >
    > > > > > "Bob Phillips" wrote:
    > > > > >
    > > > > > > Link the checkbox to a cell, and add a worksheet formula to test

    > > that
    > > > > linked
    > > > > > > cell.
    > > > > > >
    > > > > > > --
    > > > > > >
    > > > > > > HTH
    > > > > > >
    > > > > > > RP
    > > > > > > (remove nothere from the email address if mailing direct)
    > > > > > >
    > > > > > >
    > > > > > > "teresa" <[email protected]> wrote in message
    > > > > > > news:[email protected]...
    > > > > > > > Hi - this sort of works, however if the checkbox is ticked and

    I
    > > > > > > > then change the value in K33, l6 doesnt change in tandem,
    > > > > > > > I have to untick and then tick again - think an extra line is

    > > needed
    > > > > > > > Thanks A Lot for any help
    > > > > > > >
    > > > > > > > Sub checkbox1_click()
    > > > > > > >
    > > > > > > > If CheckBox1.Value Then
    > > > > > > > Range("l6") = Range("k33")
    > > > > > > > Else
    > > > > > > > Range("l6") = 0
    > > > > > > > End If
    > > > > > > > End Sub
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




+ Reply to 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