Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2003, 04:25 AM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default control array of textbox

Please tell me how I can create textbox control array in excel macro.There is no property named index in excel macro.Please suggest alternative methods if possible.Thanks


 
Old October 24th, 2003, 09:36 AM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To make an array of textboxes:
Useful for putting something in the boxes; not so good for getting stuff out.
I take care to name all the boxes I want in the array with the same prefix: eg tBox1, tBox2 etc.: and make sure no other control is prefixed the same.
then :
dim bx as object, i as integer
dim box(10) as object
for each bx in controls
   if left(bx.name,1)="t" then
      i=i+1
      set box(i)=bx
   end if
next

This should start you off!

Selbybrock







Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox value array Stuart010 Excel VBA 2 March 16th, 2007 03:16 PM
Javascript changes to Textbox Control wyokid ASP.NET 1.0 and 1.1 Professional 2 June 28th, 2006 01:14 PM
Textbox custom control lok_tan General .NET 2 July 17th, 2005 08:30 PM
To get each textbox control in C# JelfMaria VS.NET 2002/2003 2 June 29th, 2005 12:03 AM
Textbox control style beckertc VS.NET 2002/2003 2 September 2nd, 2003 12:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.