Thread: string
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
terrysoper1973[_7_] terrysoper1973[_7_] is offline
external usenet poster
 
Posts: 1
Default string


To clear all the checkboxes can be done by putting the statment
a1.value = false for each checkbox, however, there would be a lot of
code if I need 100-200 checkboxes; so I'm asking if it is possible set
up a for next loop that replaces the a1.value = false, a2.value =
false, a3.value = false... with a simple sting that replaces the a#
part of the object with an
a(string).value = false, but I'm not sure about the syntax, or if it is
even possible.

Please help, and sorry about the file upload, we all have to be careful
about what we open, won't happen again.

The code below is used to simulate my excel sheet.


Private Sub a1_Click()
'first check box test
Worksheets("sheet1").t1.Text = "fool"

End Sub

Private Sub a2_Click()
'second check box in sheet
Worksheets("sheet1").t1.Text = "fool2"
End Sub

Private Sub Cm1_Click()
'command button to make all checkboxes false

'works until x.value = false line, stops at the x
'For c = 1 To 2
'Dim x As String
'x = "a" + c
'x.Value = False
'next c

'works
'a2.Value = False
'a3, a4, a5,...
't1.Text = ""

End Sub

Private Sub Worksheet_Activate()
'works

a1.Value = False
a2.Value = False

End Sub


--
terrysoper1973
------------------------------------------------------------------------
terrysoper1973's Profile: http://www.excelforum.com/member.php...o&userid=30161
View this thread: http://www.excelforum.com/showthread...hreadid=498925