Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array trouble
*********************
Dim HeadingsToSync As Variant HeadingsToSync = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y ********************** Why the duce doesnt y display anything other than 0? Sincerely, Arturo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array trouble
you should probably dim y as an integer and then msgbox HeadingsToSync(y)
"Arturo" wrote: ********************* Dim HeadingsToSync As Variant HeadingsToSync = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y ********************** Why the duce doesnt y display anything other than 0? Sincerely, Arturo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array trouble
It is showing 0,1,2,3,4,5 for me one at a time.
Do you really want to show the array index? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Arturo" wrote in message ... ********************* Dim HeadingsToSync As Variant HeadingsToSync = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y ********************** Why the duce doesn't y display anything other than 0? Sincerely, Arturo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array trouble
This:
Option Explicit Sub testme() Dim HeadingsToSync As Variant Dim y As Variant HeadingsToSync _ = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y End Sub showed: 0, 1, 2, 3, 4, 5 for me. And did you really mean to show the index? Maybe: Option Explicit Sub testme() Dim HeadingsToSync As Variant Dim iCtr As Long HeadingsToSync _ = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For iCtr = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox HeadingsToSync(iCtr) Next iCtr End Sub And I got to see the headers. This also showed the headers: Option Explicit Sub testme() Dim HeadingsToSync As Variant Dim myElement As Variant HeadingsToSync _ = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For Each myElement In HeadingsToSync MsgBox myElement Next myElement End Sub Arturo wrote: ********************* Dim HeadingsToSync As Variant HeadingsToSync = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y ********************** Why the duce doesnt y display anything other than 0? Sincerely, Arturo -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array trouble
testing to see the value
"Bob Phillips" wrote: It is showing 0,1,2,3,4,5 for me one at a time. Do you really want to show the array index? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Arturo" wrote in message ... ********************* Dim HeadingsToSync As Variant HeadingsToSync = Array("1", "2", "3", "ABC", "ABC %Total", "123ABC / 321CBA") For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) MsgBox y Next y ********************** Why the duce doesn't y display anything other than 0? Sincerely, Arturo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trouble with Array multiple return formula | Excel Discussion (Misc queries) | |||
Trouble Passing An Array | Excel Programming | |||
Trouble shooting#NA error in Array formula | Excel Discussion (Misc queries) | |||
Trouble increasing the array number and capacity? | Excel Programming | |||
Trouble to sort an array in Excel using VBA | Excel Programming |