CheckBox (unclicking) Question

  • Thread starter Thread starter jlarkin
  • Start date Start date
J

jlarkin

I have a simple spreadsheet that I am working on.

I have a series of checkboxes, and when you click it, it 'highlights
or 'lights up' the cells.

Range("C54:F54").Select
Range("F54").Activate
Selection.Interior.ColorIndex = 36
ActiveSheet.CheckBox26.BackColor = &H80FFFF
Range("A54").Select

Simple question; Is there a way to have it so when the checkbox i
UNCLICKED, ie, value = false, that it becomes no longer highlighted
I've tried

if activesheet.Checkbox26.Value = False then
Range("C54:F54").Select
Range("F54").Activate
Selection.Interior.ColorIndex = 36
ActiveSheet.CheckBox26.BackColor = &H80FFFF
end if

or something along those lines in the 'declarations' section... but i
did not work. My Programming skills are kinda weak, so any help woul
be AWESOME.

Thanks,

JLarkin
 
correct me if i am wrong:

as far as i can see, you are using the same format for both true an
false conditions for the checkbox. the same formatting -

Selection.Interior.ColorIndex = 36
ActiveSheet.CheckBox26.BackColor = &H80FFFF

- exists in both conditions, so thats probably why you are not seein
any difference whether you check or uncheck the box.

again, sorry if i am wrong
 
Hi
you have to put both options in the click code of your checkbox. Using
an If statement to determine the status of the checkbox.

As addition: No need for select statement. Use something like:
Range("C54:F54").Interior.ColorIndex = 36
instead
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top