I used this in Excel and it works fine.
dim varScreen (0 to 2) as string
varScreen(0) = \"sample 1\"
varScreen(1) = \"sample 2\"
varScreen(2) = \"sample 3\"
VBScript's (variables and) arrays can't be typed, so no "as Whatever". VBscript's arrays are zero-based, so no "(x To y)" but only "(z)" where z is the last index (not the size) of the array. In code:
>> Dim varScreen(2)
>> varScreen(0) = "sample 1"
>> varScreen(1) = "sample 2"
>> varScreen(2) = "sample 3"
>> WScript.Echo Join(varScreen, "|")
>>
sample 1|sample 2|sample 3
>>
You can also create arrays dynamically using the Array function. Sometimes this is more convenient than assigning array elements separately.
Dim arr
arr = Array("sample 1", "sample2", "sample 3")