View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
baj baj is offline
external usenet poster
 
Posts: 24
Default Run VBA on Checkbox Value

Hi,

Sorry the programcode got a bit messed up with the commentary so I try
again :

If you fill in a checkbox this means basically that you put the value
on TRUE, if you unfill it you put it on FALSE so you can connect a
little procedure with it. With a simple If...Then Structure you can Do
an action (fill certain cells) or UnDo (erase) the action :


Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
TextBox1 = "one"
Else
TextBox1 = ""
End If
End Sub

I used a textbox in a userform that get s filled with the word "one" if
the Checkbox1 is clicked on
and this textbox is erased when it s been unchecked again
ofcourse you can replace these steps by the
steps filling/erasing cells in a worksheet

Bye
Baj