ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to access all the textboxes inside a frame? (https://www.excelbanter.com/excel-programming/406694-how-access-all-textboxes-inside-frame.html)

Yajiv

How to access all the textboxes inside a frame?
 
I have some 10 text boxes inside a frame. how can i iterate through
them?

John

How to access all the textboxes inside a frame?
 
something like following may do what you want:

Dim i As Integer
For i = 1 To 10
Controls("TextBox" & i).Text = i
Next
--
JB


"Yajiv" wrote:

I have some 10 text boxes inside a frame. how can i iterate through
them?


Rick Rothstein \(MVP - VB\)[_1338_]

How to access all the textboxes inside a frame?
 
This code will find each of them for you...

Dim C As Control
For Each C In Me.Controls
If C.Parent.Name = "Frame1" Then
If TypeName(C) = "TextBox" Then
'
' You found a TextBox inside Frame1
' Put your code for it here.
'
End If
End If
Next

Rick


"Yajiv" wrote in message
...
I have some 10 text boxes inside a frame. how can i iterate through
them?




All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com