RE: Can you fill an array from the contents of a single cell
- From: Dan Troxell <DanTroxell@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 May 2006 07:11:01 -0700
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
- Follow-Ups:
- RE: Can you fill an array from the contents of a single cell
- From: Tom Ogilvy
- RE: Can you fill an array from the contents of a single cell
- Prev by Date: Re: HasFormula() vs. has a "numeric" entry
- Next by Date: RE: Functions Trigger
- Previous by thread: Help using Transpose
- Next by thread: RE: Can you fill an array from the contents of a single cell
- Index(es):
Relevant Pages
|