Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Calling objects

I have some textboxes named TB1 thorugh to TB10. I want to
call these text boxes using a for-next loop. How can I
make this work? This is kind of what I want to happen, but
it obviously doesn't work...

for a =1 to 10
TB a .value="Whatever"
next a

Thank you for any help you can give me on this matter!!!

Stewart
MOS Excel Expert (not that it's doing me much good!!!)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Calling objects

Hi Stewart,

Here's one way to do it:

Dim lCount As Long
For lCount = 1 To 10
Me.Controls("TB" & CStr(lCount)).Value = lCount
Next lCount

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Stewart" wrote in message
...
I have some textboxes named TB1 thorugh to TB10. I want to
call these text boxes using a for-next loop. How can I
make this work? This is kind of what I want to happen, but
it obviously doesn't work...

for a =1 to 10
TB a .value="Whatever"
next a

Thank you for any help you can give me on this matter!!!

Stewart
MOS Excel Expert (not that it's doing me much good!!!)



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
Calling an Add-In BillCPA Excel Discussion (Misc queries) 2 August 11th 05 09:32 PM
calling sub from another workbook James[_9_] Excel Programming 1 October 14th 03 06:06 PM
Calling functions from dll T.K Kullervo Excel Programming 0 September 29th 03 09:55 AM
Calling certain functions within VBA Myrna Larson[_2_] Excel Programming 0 August 11th 03 10:57 PM
Calling From Shapes Chip Pearson Excel Programming 0 August 6th 03 12:42 AM


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