RE: Can you fill an array from the contents of a single cell

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Tom,

That did get rid of errors, but I don't have any choices in the list box. I
have this code in the
Sub ArmSelect1_Change() routine. It was private, but I changed it to public
and still nothing. So then I moved it to the Private Sub CtlrSelect1_Click()
routine, but still no list.

While I am asking, do you have any recommendations for goog VBA reference &
how to books.

--
Dan Troxell - Staubli Corp


"Tom Ogilvy" wrote:

Unless this is a multicolumn Combobox try this:

Range("ARMList").Find(What:=ArmSelect1.Text, _
LookIn:=xlValues, _
Lookat:=xlWhole, _
SearchOrder:=xlColumns).Activate
UserForm1.CtlrSelect1.List = Split(ActiveCell.Offset(0, 2).Value,",")

--
Regards,
Tom Ogilvy


"Dan Troxell" wrote:

I am trying to populate a Combobox list based on the choice of the previous
combobox. I can store the choices in a table in the proper array format.

Example "CS8", "CS8M" in the cell. But it will not let me assign that to
an array field. Is this possible. Now matter how I try I seem to get Type
Mismatch.

See code below.

Dim CtlrArray() As String ' Defined as string array for ComboBox List
Dim Ctlrs() As Variant ' Defined as Variant array fo move
Dim N As Single 'Index value
N = 0
Dim CtlrUp As Single ' Variable for upper boundry of array

Range("ARMList").Find(What:=ArmSelect1.Text, LookIn:=xlValues,
Lookat:=xlWhole, SearchOrder:=xlColumns).Activate

MsgBox "Active Cell Value = " & ActiveCell.Offset(0, 2) ' used to verify data

' Tried to set a variant array to the value of the cell as described above

Ctlrs() = ActiveCell.Offset(0, 2).Value

For N = 0 To CtlrUp Step 1
CtlrArray(N) = Ctlrs(N)
Next N
ArmDimension = ActiveCell.Offset(0, 3).Value
Arm1Dim = ArmDimension
UserForm1.CtlrSelect1.List(0, 1) = CtlrArray

Spreadsheet looks like this:
ARM WEIGHT CONTROLLERS DIMENSIONS
0
TX40 57 CS8C,CS8CTrans, 48 X 52 X 40
TX60 86 "CS8C","CS8CTrans", 48 X 52 X 60

Note: I was trying both with and without " " on strings.

Thanks for any direction.

Dan Troxell - Staubli Corp
.



Relevant Pages

  • Re: Updated datestamp doesnt work
    ... Public Sub StoreMyOldVals ... ' store values of current row in array ... Dim dbs As DAO.Database, rst As DAO.Recordset ... Dim var As Variant ...
    (microsoft.public.access.gettingstarted)
  • Re: Updated datestamp doesnt work
    ... Public Sub StoreMyOldVals ... ' store values of current row in array ... Dim dbs As DAO.Database, rst As DAO.Recordset ... Dim var As Variant ...
    (microsoft.public.access.gettingstarted)
  • Re: Updated datestamp doesnt work
    ... Public Sub StoreMyOldVals ... ' store values of current row in array ... Dim dbs As DAO.Database, rst As DAO.Recordset ... Dim var As Variant ...
    (microsoft.public.access.gettingstarted)
  • RE: Routine running slow (memory leak?)
    ... In the first sub, ListAuditResults, I set up the 3 past ranges using the Set ... of no memory leak) as I need them all the time until the routine ends. ... it would never run again and I could put "Set Hardrng = Nothing" ... Dim PasteStartCell As String ...
    (microsoft.public.excel.programming)
  • Re: referencing/sorting arrays
    ... Public Sub SortArrayAscendAs Integer) ... 'Sort an array in ascending order ... Dim Idx01 As Integer ... >> If no data type declaration is made for the argument it becomes a variant. ...
    (microsoft.public.excel.programming)