Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
Hi all,
I remember that there is a setting in property window to make all the textbox in an array, but not found in excel 2003 VBA, need to write code? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
One can make control array in VB (each control has the same name and
an index, and Index is a Property). Excel VBA (2003 at least) does not offer this. You can loop through all Textboxes on a UserForm like this: For Each c In Me.Controls If TypeName(c) = "TextBox" Then Debug.Print c.Name 'do something else End If Next c End Sub Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
Thanks...but how to group them into an array?
How to code in the 'do something else ? "merjet" egroups.com... One can make control array in VB (each control has the same name and an index, and Index is a Property). Excel VBA (2003 at least) does not offer this. You can loop through all Textboxes on a UserForm like this: For Each c In Me.Controls If TypeName(c) = "TextBox" Then Debug.Print c.Name 'do something else End If Next c End Sub Hth, Merjet |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
Thanks...but how to group them into an array?
They are in the Controls collection already. If you want them in an array, you will have to build it youself. How to code in the 'do something else ? I don't know what you are trying to do or why you want them in an array. Merjet |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
ic..I just want to get every textbox value and perform some calculation then
put the result in some cells. How to get the value of those textbox in the controls collection? "merjet" groups.com... Thanks...but how to group them into an array? They are in the Controls collection already. If you want them in an array, you will have to build it youself. How to code in the 'do something else ? I don't know what you are trying to do or why you want them in an array. Merjet |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
ic..I just want to get every textbox value and perform some calculation then
put the result in some cells. How to get the value of those textbox in the controls collection? For Each c In Me.Controls If TypeName(c) = "TextBox" Then Debug.Print c.Value ' or c.Text z = c.Value 'assign to variable End If Next c c.Value is String, so convert or assign to a numeric variable to do calcs. Merjet |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
Thanks
How do it define the sequence of textboxes? By the last number of its name? "merjet" egroups.com... ic..I just want to get every textbox value and perform some calculation then put the result in some cells. How to get the value of those textbox in the controls collection? For Each c In Me.Controls If TypeName(c) = "TextBox" Then Debug.Print c.Value ' or c.Text z = c.Value 'assign to variable End If Next c c.Value is String, so convert or assign to a numeric variable to do calcs. Merjet |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox array
How do it define the sequence of textboxes? By the last number of its name?
Yes, if you accepted the default names Textbox1, Textbox2, etc. Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set Textbox value = large(ARRAY,k) | Charts and Charting in Excel | |||
Array of values in 1 textbox | Excel Programming | |||
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming |