Results 1 to 6 of 6

ActiveX Checkbox code not working

Threaded View

  1. #1
    Registered User
    Join Date
    05-12-2020
    Location
    Ohio, US
    MS-Off Ver
    365
    Posts
    7

    Question ActiveX Checkbox code not working

    Hi everyone,

    I'm fairly new to VBA, and I can't seem to get my code to work for these checkboxes. My spreadsheet is a sales quoting sheet, and the checkboxes are 3 additional options. They need to be enabled/disabled based on the response to a drop-down on a previous cell. I'll put the code I have below. I don't know if I'm not "activating" the code right, or if the code itself is wrong.


    Private Sub Worksheet_Change(ByVal Target As Range)
      If Target.Address(0, 0) = "V17" Then
        If Target.CountLarge > 1 Then Exit Sub
        If Target.Value = "" Then Exit Sub
        Select Case UCase(Target.Value)
          Case UCase("Prosurance")
            ActiveSheet.DrawingObjects("CheckBox1").Value = True
            ActiveSheet.DrawingObjects("CheckBox2").Value = True
            ActiveSheet.DrawingObjects("CheckBox3").Value = True
          Case UCase("Care")
            ActiveSheet.DrawingObjects("CheckBox1").Value = True
            ActiveSheet.DrawingObjects("CheckBox2").Value = False
            ActiveSheet.DrawingObjects("CheckBox3").Value = False
          Case UCase("MI Only")
            ActiveSheet.DrawingObjects("CheckBox1").Value = False
            ActiveSheet.DrawingObjects("CheckBox2").Value = False
            ActiveSheet.DrawingObjects("CheckBox3").Value = False
          Case UCase("Assurance")
            ActiveSheet.DrawingObjects("CheckBox1").Value = True
            ActiveSheet.DrawingObjects("CheckBox2").Value = True
            ActiveSheet.DrawingObjects("CheckBox3").Value = True
          Case UCase("PM Only")
            ActiveSheet.DrawingObjects("CheckBox1").Value = False
            ActiveSheet.DrawingObjects("CheckBox2").Value = False
            ActiveSheet.DrawingObjects("CheckBox3").Value = False
        End Select
      End If
    End Sub
    Last edited by rudymay; 05-27-2020 at 09:46 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ActiveX Checkbox Not Working
    By EdwardSnowden in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-24-2019, 04:14 PM
  2. ActiveX Checkbox to make Date Picker visible not working reliably
    By myersjster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2017, 12:43 PM
  3. ActiveX Combo Box and VBA code not working on multiple Data Validation Dropdown Lists
    By ringonohitorigoto in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2016, 04:05 PM
  4. Do I have to write a seperate code for each ActiveX checkbox to hide rows?
    By Angelammarten in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-20-2014, 04:55 PM
  5. Replies: 9
    Last Post: 07-31-2014, 09:56 PM
  6. Replies: 1
    Last Post: 07-27-2014, 10:57 AM
  7. Code in ActiveX Image Box is not working
    By mgalterio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2012, 12:58 PM

Tags for this Thread

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