Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a matrix of 400 commandbuttons (20 by 20) on a Userform and wish to loop through them, -not horizontally-, but vertically viz. 1,21,31...391, 2, 22, 32...392 through 380,390,400. Since the For each .... Next construct sweeps horizontally, this popular loop fails. I have attempted, to no avail, to coerce Excel using conventional For..Next loop with 20 increments as in: num=1 For n = 1 to 400 Step 20 Controls("CommandButton" & n).Caption = num num = num +1 If n\400=4 Then n = (n-400)+1 Next The above code is merely demonstrative as it only assign captions. The real object is to get a handle to do the vertical cosine-curve looping. Any ideas? Thanks David -- davidm ------------------------------------------------------------------------ davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645 View this thread: http://www.excelforum.com/showthread...hreadid=505995 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CommandButtons | Excel Programming | |||
Using For/Next Loop To Generate 4 CommandButtons On A UserForm Results In A Runtime Error 91 | Excel Programming | |||
Commandbuttons | Excel Programming | |||
Do While, OnTime and CommandButtons | Excel Programming | |||
commandbuttons properties | Excel Programming |