Results 1 to 8 of 8

CheckBox state not passing to the sub - Please Help

Threaded View

  1. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,747

    Re: CheckBox state not passing to the sub - Please Help

    If it's a Forms checkbox then your code will not work. That code is for an ActiveX checkbox. You have two options. My personal favorite is delete your checkbox then create an ActiveX checkbox and name it CheckBox9. Use the same code.

    Second option is modify your code. Note that you must make it Public and then do Assign Macro for the checkbox to assign it to this code:

    Public Sub CheckBox9_Click()
       '
       ' Macro1 Macro
    
       
       
       If Sheet1.CheckBoxes("check box 9") = 1 Then
          ActiveSheet.Tab.ColorIndex = 35
       Else
          'If CheckBox9 = False Then
          ActiveSheet.Tab.ColorIndex = 15
       End If
       
       
       '
    End Sub
    Last edited by 6StringJazzer; 12-11-2012 at 03:02 PM. Reason: was check box 1 in my test case, OP needs 9

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