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: 77
Default Programatically set control source - not working

Hi,

I have two (related issues). Firstly that I have 12 user forms, each
with upwards of 600 text boxes (yes i'm creating a calendar!). Each of
these needs the control source setting. This is issue 1!

To solve this I figured the easiest way was to name these textboxes in
numerical order and then programatically set the control source.
(naming them still takes ages but i think it's the better choice!)

So my text boxes are named T45, T46, T47 etc and the controlsource
therefore needs to be set to Sheet4!g45, sheet4!g46, sheet4!g47 etc

So i quickly wrote the below code, which runs fine but does nothing to
change the controlsource of the textboxes! Grrrr!

Private Sub UserForm_Initialize()
Dim i, ctrl, srce, K
K = 70
For i = 45 To 99
srce = ("Sheet4!g" & K)
ctrl = ("T" & i)
Debug.Print ctrl
Debug.Print srce
Me.Controls(ctrl).ControlSource = (srce)
K = K + 1
Next i


Can anybody suggest why this is doing absolutely NOTHING?! Thanks in
advance
 
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
How to programatically control a 3D-sum? Ake Excel Worksheet Functions 6 February 2nd 06 09:20 AM
programatically change the data source of Pivots Help me Excel Programming 1 November 10th 05 05:31 AM
Programatically control a shapes TextBox Francis Brown[_2_] Excel Programming 2 September 26th 05 06:19 PM
Adding a Control programatically Richard Buttrey Excel Programming 9 July 5th 05 08:34 AM
Programatically control picture property of Image control Brassman[_5_] Excel Programming 5 May 24th 05 09:32 PM


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