Hello all you excel gurus.
So I am trying create a function that will return an array. The reason for the function is that the code has to iterate a number of times and the array will be used in its own loop later in the code process.
I tried the following:
i = the iteration number
the function is called with:
the function is:
So I need to understand where I am messing up so that in the future I wont have to bother you nice people.
Any ideas?
Thanks,
Rich
So I am trying create a function that will return an array. The reason for the function is that the code has to iterate a number of times and the array will be used in its own loop later in the code process.
I tried the following:
i = the iteration number
the function is called with:
Code:
arrLINEb() As Variant
arrLINEb = array_arrlineb(i)
the function is:
Code:
Function array_arrlineb(i As Integer) As Variant
Dim arrLINEb() As Variant
Select Case i
Case 11
arrLINEb = Array("310000")
Case 12
arrLINEb = Array("331000")
Case 13
arrLINEb = Array("412600", "412700", "413600", "413700", _
"413900", "414900", "416600", "417100", _
"417200", "420100", "422100", "422200", _
"422500", "425100", "428300", "428500", _
"428700", "438400", "439400", "439700", _
"439800", "480100", "480200", " 490100")
Case 16
arrLINEb = Array("412600", "412700", "413600", "416600", _
"417100", "417200", "438400", _
"439400", "439700")
Case 17
arrLINEb = Array("417100", "422100", "422200", "422500", _
"425100", "428300", "428500", "428700", _
"438400", "439800")
Case 18
arrLINEb = Array("480100", "480200", "490100")
Case 22
arrLINEb = Array("480100", "490100")
Case 23
arrLINEb = Array("480100", "480200", "490100")
Case 24
arrLINEb = Array("480200")
Case 26
arrLINEb = Array("422100", "422500", "425100", "428300", _
"428500", "428700")
Case 27
arrLINEb = Array("422100", "422500", "425100", "428300", _
"428500", "428700")
Case 29
arrLINEb = Array("422200")
Case 30
arrLINEb = Array("422100", "422500", "425100", "428300", _
"428500", "428700")
Case 33
arrLINEb = Array("480200")
Case 34
arrLINEb = Array("422200")
Case 37
arrLINEb = Array("310000")
Case 43
arrLINEb = Array("331000")
Case 44
arrLINEb = Array("310000")
Case 49
arrLINEb = Array("420100", "422100", "422200", "425100", _
"480100", "480200", "490100")
Case 50
arrLINEb = Array("422200", "480200")
Case 55
arrLINEb = Array("331000")
Case Else
arrLINEb = Array("")
End Select
array_arrlineb = Array(arrLINEb)
End Function
So I need to understand where I am messing up so that in the future I wont have to bother you nice people.
Any ideas?
Thanks,
Rich