PDA

View Full Version : [SOLVED:] Unchecked checkbox if cell is blank



cjvdg
01-20-2021, 10:20 PM
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_INFO!$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×

p45cal
01-21-2021, 06:42 AM
One line:
ActiveSheet.CheckBoxes("Check Box 1").Value = Len(Range("X18").Value) > 0

cjvdg
01-21-2021, 04:53 PM
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×