Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
How do I create a For loop within a For loop? Linking to specific cells in pivot table Excel Programming 2 January 24th 05 08:05 AM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 02:00 AM.

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

About Us

"It's about Microsoft Excel"