+ Reply to Thread
Results 1 to 6 of 6

Macro for adding VBA checkboxes

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Miton Keynes
    MS-Off Ver
    Excel 2003
    Posts
    7

    Macro for adding VBA checkboxes

    Hi, I don't suppose anyone has a macro that would be capable of inserting VBA checkboxes into cells b3 to b1001 which when ticked/ unticked return the value of yes / no in the adjacent cell in in the C column?

    Thanks in advance!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro for adding VBA checkboxes

    Try a different way, see my example here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,595

    Re: Macro for adding VBA checkboxes

    Maybe:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    11-22-2011
    Location
    Miton Keynes
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro for adding VBA checkboxes

    Thanks for the replies, both methods seem to work but am facing another problem with it!

    I want the output of the checkbox eg "true or false" to be used by another piece of VBA code I have in unlocking a cell. eg, if i tick the tick box in Cell B3, it displays "TRUE" in C3and then the VBA code should unlock Cell D3 for editing.

    If I manaully type "TRUE" into cell C3 then D3 unlocks fine but if I use the tick boxes to display "TRUE" in C3, D3 will not unlock.

    It is as if VBA will not recognise the result of the checkbox as a "TRUE" value?

    Very confused!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,595

    Re: Macro for adding VBA checkboxes

    You need to manually enter data for a Worksheet Change event to fire. In this case, it's a bit like changing a value and a formula (dependent on it) showing a different value.

    I suspect Roy's method will work better for what you want.

    Regards

  6. #6
    Registered User
    Join Date
    11-22-2011
    Location
    Miton Keynes
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro for adding VBA checkboxes

    Ah, I see. That makes sense. Will carry on playing with it!

    Thanks for you help

+ 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