View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DavidC[_2_] DavidC[_2_] is offline
external usenet poster
 
Posts: 44
Default A VBA code that clicks a checkbox

Try this

Sub Click_Me()
a = CheckBox10
If ActiveSheet.Range("A130").Value = "Mortgage" Then
ActiveSheet.CheckBox10.Value = True
Else
ActiveSheet.CheckBox10.Value = False

End If

End Sub

You can see the differences. Basically each cell has to
have a value assigned.

BOL

DavidC
-----Original Message-----
Having some difficulty with VBA code. Any help is

appreciated...
What I am trying to do is to have an "IF" command that

would
CHECK a checkbox in excel if a certain cell has a certain

text in it,
i.e.

Sub Click_Me()
If "A12" = "Mortgage" Then CheckBox10_Click = True
End Sub

What am I doing wrong?

Thank you very much in advance.


---
Message posted from http://www.ExcelForum.com/

.