Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all.
I'm (foolishly) creating a multipage userform laid out like a calendar, which each page being a month. Each day has 11 entries, and each entry has 2 text boxes. So I have to have 22 text boxes per day, which for the year adds up to over 8000 textboxes! Each of these textboxes needs a controlsource set to a specific cell on a sheet in the wb. As I see it I have two choices; Rename 8000 textboxes so that they are easily programmed (names such as Time1, Time2, Entry1, Entry2) in a loop - then i could set the controlsource programatically Or leave the names (these are random in no order, so the first might be TextBox367 and the next might be TextBox930) and manually set the controlsource of 8000 boxes! So - I thought i'd try another way. Start again and write code to add the 600+ boxes required for one month, and whilst adding giving them numerical names in order (Time1, Time2, Time3) etc. However I cannot get this to work. My code; For i = 1 To 11 nm = "Time" & i Set mytextbox = VBAProject.July08.MultiPage1.july.Controls.Add("Fo rms.TextBox.1") With mytextbox .Name = nm .Left = 50 .TOP = 50 .Height = 12.75 .Width = 30 .Visible = True End With Next i is in the userform_initialise. The textboxes are created....however as soon as I close the userform the textboxes disappear. I need them to be permanent. (I know I can create them again next time I initialise the form however I want them there all the time!).They do not exist when I view the form in design mode. Can anybody solve my disappearing textbox mystery please? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting up Treasure Hunt spreadsheet | Excel Discussion (Misc queries) | |||
Active cell hunt | Excel Programming | |||
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them | Excel Programming | |||
commandbar hunt | Excel Programming | |||
Code to Hunt Linked Cells | Excel Programming |