LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code to access Controls via variables?

I wonder if there is a way to use variables to iterate controls
(textbox) on a form via VBA i Exel, just as you can in Access
Something Like:
Dim ctrlS As Control
...
For n = 1 to 60
strSkudd = "txtSkudd"& n
Set ctrlS = Controls(strSkudd)
....
Range("A1").Offset((i + intR) - 2, 6 + j) = ctrlS.Text

....
This does not work, but is it posible, and how??

I have a form with plenty of textboxes (txtSkudd1, txtSkudd2 etc..
txtSkudd60) on which I want to write to a spreadsheet from and vice
verse .

Kjell s J
 
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
running same code with multiple controls ben Excel Programming 19 January 13th 05 04:19 PM
Running Code From Controls On Other Forms bazman1uk Excel Programming 3 August 23rd 04 05:36 PM
how to access programatically added controls don bowyer Excel Programming 3 August 8th 04 11:28 AM
Using same code for Multiple cmd Controls Ruan[_3_] Excel Programming 2 January 9th 04 10:50 PM
Accessing ActiveX Controls using VBA - can't use Control.Name to access. Rob Bovey Excel Programming 2 July 30th 03 09:11 AM


All times are GMT +1. The time now is 11:51 PM.

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

About Us

"It's about Microsoft Excel"