Consulting

Results 1 to 3 of 3

Thread: Unchecked checkbox if cell is blank

  1. #1
    VBAX Regular
    Joined
    Jan 2021
    Posts
    14
    Location

    Unchecked checkbox if cell is blank

    Hello! So I'm currently having a problem with my checkbox. The case is I have a cell with a VLOOKUP formula and there's a possibility that sometimes it doesn't have any value. So, the checkbox depends on the said cell. If it doesn't have any value, the checkbox should be unchecked or vice versa.

    VLOOKUP formula that I used
    =IF(VLOOKUP($F$10,STUDENTS_INFO!$C:$T,15,0)="","",VLOOKUP($F$10,STUDENTS_IN FO!$C:$T,15,0))
    I tried using this two codes but none of them is working.

    If Not IsEmpty(Range("X18").Value) Then
    ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn
    Else ActiveSheet.CheckBoxes("Check Box 1").Value = xlOff End If
    If Range("X18").Value = "" Then
    ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn
    Else ActiveSheet.CheckBoxes("Check Box 1").Value = xlOff End If
    Enable GingerCannot connect to Ginger Check your internet connection
    or reload the browserDisable in this text fieldEditEdit in GingerEdit in Ginger×

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    One line:
    ActiveSheet.CheckBoxes("Check Box 1").Value = Len(Range("X18").Value) > 0
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Regular
    Joined
    Jan 2021
    Posts
    14
    Location
    Quote Originally Posted by p45cal View Post
    One line:
    ActiveSheet.CheckBoxes("Check Box 1").Value = Len(Range("X18").Value) > 0
    Thank you!

    Enable GingerCannot connect to Ginger Check your internet connection
    or reload the browserDisable in this text fieldEditEdit in GingerEdit in Ginger×

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •