Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default assign objects into array or object variable?


Hi

Does anyone know how to assign objects, e.g. Label, TextBox and etc
into an array?

I can't even assign a label into an object variable. Can anyone hel
please? Thank you.

All the best,
Fendi

--
Fendi
-----------------------------------------------------------------------
Fendic's Profile: http://www.excelforum.com/member.php...fo&userid=2395
View this thread: http://www.excelforum.com/showthread.php?threadid=38946

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default assign objects into array or object variable?

This works for me

Dim ary
Dim ctl
ReDim ary(1 To 1)
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If UBound(ary) < 1 Then
ReDim Preserve ary(1 To UBound(ary) + 1)
ary(UBound(ary)) = ctl
End If
End If
Next ctl


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Fendic" wrote in
message ...

Hi

Does anyone know how to assign objects, e.g. Label, TextBox and etc,
into an array?

I can't even assign a label into an object variable. Can anyone help
please? Thank you.

All the best,
Fendic


--
Fendic
------------------------------------------------------------------------
Fendic's Profile:

http://www.excelforum.com/member.php...o&userid=23959
View this thread: http://www.excelforum.com/showthread...hreadid=389461



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
Add new worksheet and assign it to an object variable? Thief_ Excel Programming 2 April 4th 05 07:21 AM
FileSearch Object - Cannot assign to variable Alan Excel Programming 1 January 24th 05 03:41 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Dynamically Assign Objects to Form Objects. The Vision Thing Excel Programming 2 December 11th 04 04:02 PM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 05:43 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"