Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop help please!
I just dont quite grasp Loops yet. :sigh: Mainly because I rarely need them. Any how, I'm stuck so to speak, I have 60 TextBox's to iterate thru an check a condition, how do I complete this? For code, all i have is the first textbox. "If Worksheets("sheet2").Range("a10").Interior.ColorIn dex = 3 Then TextBox14.Visible = False End If -- Rick_Stanic I am m ----------------------------------------------------------------------- Rick_Stanich's Profile: http://www.excelforum.com/member.php...fo&userid=2895 View this thread: http://www.excelforum.com/showthread.php?threadid=51705 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop help please!
Dim i As Long With Worksheets("sheet2") For i = 1 To 50 .OLEObjects("TextBox" & i).Visible = _ .Range("A" & 10 + 1).Interior.ColorIndex = 3 Next i End With This compares Textbix1 with A11, 2 with A12, etc. -- HTH Bob Phillips (remove nothere from the email address if mailing direct) "Rick_Stanich" wrote in message news:Rick_Stanich.23wtta_1141080601.9758@excelforu m-nospam.com... I just dont quite grasp Loops yet. :sigh: Mainly because I rarely need them. Any how, I'm stuck so to speak, I have 60 TextBox's to iterate thru and check a condition, how do I complete this? For code, all i have is the first textbox. "If Worksheets("sheet2").Range("a10").Interior.ColorIn dex = 3 Then TextBox14.Visible = False End If" -- Rick_Stanich I am me ------------------------------------------------------------------------ Rick_Stanich's Profile: http://www.excelforum.com/member.php...o&userid=28957 View this thread: http://www.excelforum.com/showthread...hreadid=517055 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop help please!
Now I see how the loop is created! Unfortunately I get an error at the ".OLEObjects" line. "Run-time error 1004" "Unable to get OLEObjects property of the worksheet class" I think "OLEObjects" pertains to worksheets and not TextBox's. Maybe I did not mention I am working from a Form. (maybe ;) ) -- Rick_Stanich I am me ------------------------------------------------------------------------ Rick_Stanich's Profile: http://www.excelforum.com/member.php...o&userid=28957 View this thread: http://www.excelforum.com/showthread...hreadid=517055 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop help please!
This code runs thru but i am not getting the desired affect, Visible false for the condition. Dim obj As OLEObject Dim i as Long For Each obj In Worksheets("sheet2").OLEObjects If TypeOf obj.Object Is MSForms.TextBox Then With Worksheets("sheet2") For i = 1 To 50 .OLEObjects("TextBox" & i).Visible = _ .Range("A" & 10 + 1).Interior.ColorIndex = 3 Next i End With End If Next Any help is appreciated -- Rick_Stanic I am m ----------------------------------------------------------------------- Rick_Stanich's Profile: http://www.excelforum.com/member.php...fo&userid=2895 View this thread: http://www.excelforum.com/showthread.php?threadid=51705 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
How do I create a For loop within a For loop? | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |