Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default making checkbox into a variable


Hello,

I want to make the checkbox suffix number into a variable so that I can
loop the whole process instead of doing this long process until
CheckBox120:


Code:
--------------------
Private Sub CommandButton1_Click()
Dim startrow%
startrow = 1
If CheckBox1.value Then Call Variables(startrow)
End If
If CheckBox2.value Then Call Variables(startrow + 2)
End If
If CheckBox3.value Then Call Variables(startrow + 3)
End If
End Sub
--------------------


I tried to do this but it doesn't work.


Code:
--------------------
Private Sub CommandButton1_Click()
For startrow = 1 To 120
If CheckBox + startrow + .value Then
Call Variables(startrow)
End If
Next startrow
End Sub
--------------------


Thanks a lot for your help


--
minastirith
------------------------------------------------------------------------
minastirith's Profile: http://www.excelforum.com/member.php...o&userid=34941
View this thread: http://www.excelforum.com/showthread...hreadid=546730

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default making checkbox into a variable

see answer to previous posting of this question.

--
Regards,
Tom Ogilvy


"minastirith" wrote:


Hello,

I want to make the checkbox suffix number into a variable so that I can
loop the whole process instead of doing this long process until
CheckBox120:


Code:
--------------------
Private Sub CommandButton1_Click()
Dim startrow%
startrow = 1
If CheckBox1.value Then Call Variables(startrow)
End If
If CheckBox2.value Then Call Variables(startrow + 2)
End If
If CheckBox3.value Then Call Variables(startrow + 3)
End If
End Sub
--------------------


I tried to do this but it doesn't work.


Code:
--------------------
Private Sub CommandButton1_Click()
For startrow = 1 To 120
If CheckBox + startrow + .value Then
Call Variables(startrow)
End If
Next startrow
End Sub
--------------------


Thanks a lot for your help


--
minastirith
------------------------------------------------------------------------
minastirith's Profile: http://www.excelforum.com/member.php...o&userid=34941
View this thread: http://www.excelforum.com/showthread...hreadid=546730


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
making checkbox into a variable minastirith Excel Programming 1 May 30th 06 04:30 PM
Use Variable In CheckBox Name mudraker[_353_] Excel Programming 1 April 2nd 06 03:01 PM
making a checkbox appear and disappear based on a cell's value yoram Excel Programming 10 January 24th 06 12:01 AM
Use Checkbox Value or Public Variable? Stratuser Excel Programming 2 February 12th 04 02:33 PM
Using a variable to represent a Checkbox Name(OLEObject) Mike Cooper Excel Programming 1 July 16th 03 09:40 PM


All times are GMT +1. The time now is 01:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"