+ Reply to Thread
Results 1 to 5 of 5

help with vb code to return the value of the cell to the right of the checkbox

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    help with vb code to return the value of the cell to the right of the checkbox

    Hi all

    I was wondering whether someone can help me with the following

    I have a worksheet with lots of check boxes.

    I have a code which looks at which checkbox is checked. This is a form control check box and not active x.

    What I need is if the check box is checked then to return the value of the cell which is two rows after the checkbox.

    my current code is
    Please Login or Register  to view this content.
    i placed a check box in B13. so of this checkbox its ticked i need the value of the cell d13.

    thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: help with vb code to return the value of the cell to the right of the checkbox

    the value of the cell which is two rows after the checkbox.
    but later you say you want the value from D13, when B13 is checked, and that is two columns to the right of the checkbox, not two rows below.

    Division = cb.Offset(0, 2).Value as in your code, should give you D13 where the the cb address is B13

    cb.offset(2,0) would give the value in B15, two rows below B13 which is waht you say in the first part of your post.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: help with vb code to return the value of the cell to the right of the checkbox

    Use something like this for the basis of your code:-
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: help with vb code to return the value of the cell to the right of the checkbox

    This code worked fine. Thak you for your help.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: help with vb code to return the value of the cell to the right of the checkbox

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code to populate checkbox with tick upon initialization based on Cell value being Yes
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2013, 09:58 AM
  2. [SOLVED] Forms Control checkbox and code to unlock a cell
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2013, 04:46 PM
  3. [SOLVED] Checkbox to deselect another checkbox, shorter code
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 09:59 AM
  4. Lock cell linked to checkbox when checkbox is ticked
    By simeony003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2013, 10:08 AM
  5. [SOLVED] VBA code to uncheck checkbox 2 & 3 if checkbox 1 is checked
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-25-2013, 03:10 AM
  6. [SOLVED] How do I change a checkbox to unchecked without running the code within the checkbox
    By jsunnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 09:28 PM
  7. vba to make a checkbox return Yes or No
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2009, 04:48 AM
  8. [SOLVED] I want to add a checkbox at the end to return data to a separate s
    By KISS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 10:05 AM

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