Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lists
How do I create a list?
In python, it is: variable = [1,2,3,4] Thanks, mb |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lists
I am unfamiliar with Python, perhaps someone else will post who is, but
judging by your example, I think the nearest equivalent may be called an Array? Here is a brief example, but you should read about them in help: Sub testthis() Dim vData As Variant Dim lX As Long vData = Array("Dog", "Monkey", "Horse", "Rat") For lX = 1 To UBound(vData) MsgBox vData(lX) Next lX End Sub "mb" wrote: How do I create a list? In python, it is: variable = [1,2,3,4] Thanks, mb |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lists
An array???
dim myArray as variant myarray = array(1,2,3,4) mb wrote: How do I create a list? In python, it is: variable = [1,2,3,4] Thanks, mb -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lists
The index for an array in VB(A) starts from zero (usually..),
so that should be: For lX = 0 To UBound(vData) or, in general: For lX = LBound(vData) To UBound(vData) Andrew Taylor quartz wrote: I am unfamiliar with Python, perhaps someone else will post who is, but judging by your example, I think the nearest equivalent may be called an Array? Here is a brief example, but you should read about them in help: Sub testthis() Dim vData As Variant Dim lX As Long vData = Array("Dog", "Monkey", "Horse", "Rat") For lX = 1 To UBound(vData) MsgBox vData(lX) Next lX End Sub "mb" wrote: How do I create a list? In python, it is: variable = [1,2,3,4] Thanks, mb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop down lists from multiple source lists | Excel Worksheet Functions | |||
LISTS- adding info without repeat to other lists | Excel Discussion (Misc queries) | |||
Multiple lists with repeated values for dependet drop down lists | Excel Worksheet Functions | |||
Comparing Lists to Partial Lists | Excel Programming | |||
Form lists influencing other lists | Excel Programming |