Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I cannot get an array to populate. There are a number of txtboxes on a form
filled with data. Each time the txtboxes are filled a cmdbutton is clicked and the results are saved to an array, the txtboxes are cleared ready for new data entry. It works first time round but on the second round of txtbox renewal it fails with Subscript out of Range. Elsewhere in my code this structure works but there is only 1 dimension. This is the code I am using: Public enterArray() as Variant In the initialise event: enterCount=1 '''for reasons elsewhere in code In the cmdbutton click event: Sub Test() ReDim Preserve enterArray(1 To enterCount, 0 to 4) ''''Fails here enterArray(enterCount, 0) = txtName.Text enterArray(enterCount, 1) = txtNarrative.Text enterArray(enterCount, 2) = txtDate.Text enterArray(enterCount, 3) = txtInits.Text enterCount = enterCount + 1 End Sub Could someone please show me where I have gone wrong. Thanks Geoff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Working with ranges in arrays... or an introduction to arrays | Excel Programming | |||
Arrays - declaration, adding values to arrays and calculation | Excel Programming | |||
arrays in arrays | Excel Programming | |||
Arrays | Excel Programming | |||
ARRAYS | Excel Programming |