Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ali,
Here's some sample code that loops through all controls on a UserForm and sets the captions of checkboxes according to whether they are checked or not: Dim ctl As Control For Each ctl In Me.Controls If TypeOf ctl Is MSForms.CheckBox Then With ctl.Object .Caption = IIf(.Value, "Available", "Not Available") End With End If Next ctl Regards, Jake Marx MS MVP - Excel "Ali Emre Hortacsu" wrote in message ... Hi there I've about 30 checkboxes I want all of them to do the same set of instructions that I've given to Private Sub CheckBox1_Click() something like this: If CheckBox1.Value = True Then CheckBox1.Caption = "Avaliable" End If If CheckBox1.Value = False Then CheckBox1.Caption = "Not Avaliable" Dim Who, Title, Person, MyDate, When Who =....... I've tried for loop but had some obvious problems with the coding and the variables.... any help appriciated. THanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Checkbox | Setting up and Configuration of Excel | |||
checkbox | Excel Discussion (Misc queries) | |||
checkbox | Excel Discussion (Misc queries) | |||
How to have Checkbox A uncheck with checked Checkbox B | Excel Discussion (Misc queries) |