# bi-dimensional arrays

1. ## bi-dimensional arrays

hello guys, i have a problem with an bi-dimensional array.

This is my code

I declared a array

dim fee(1 to 2, 1 to 4) as string
Dim i as integer

Fee(1, 1) = "mgt"
Fee(1, 3) = "mgt_mgt"
Fee(1, 4) = "othersfees"

For i = 1 To 4
'in order to evaluate this formula i need the fee name and client code
StrFormula4 = "Fees(""" & Fee(1, i) & """,""" & Client& """)"
Fee(2,i) = Evaluate(StrFormula4)
Next i

msgbox fee(2,i) ' I
and once the formula evaluate I need the result.

I do not know very well manipulating arrays; could someone help me on
that

Ina

2. ## Re: bi-dimensional arrays

Hi
You seem to have a variable called Client so:

function MakeFeeArray(Client as String) as Variant
dim fee(1 to 2, 1 to 4) as string
Dim i as integer, StrFormula4 as String

Fee(1, 1) = "mgt"
Fee(1, 3) = "mgt_mgt"
Fee(1, 4) = "othersfees"

For i = 1 To 4
'in order to evaluate this formula i need the fee name and client code

StrFormula4 = "Fees(""" & Fee(1, i) & """,""" & Client& """)"
Fee(2,i) = Evaluate(StrFormula4)
Next i
MakeFeeArray = Fee

end function

In another sub/function you can then access MakeFeeArray for "Client1"
by
Dim myArrayValues as Variant
myArrayValues = MakeFeeArray("Client1")

and use myArrayValues(1,1) etc

regards
Paul

3. ## RE: bi-dimensional arrays

the only problem I can see is you need a space between Client and the ampersand

""",""" & Client& """)"

should be

""",""" & Client & """)"

--
Regards,
Tom Ogilvy

"ina" wrote:

> hello guys, i have a problem with an bi-dimensional array.
>
>
> This is my code
>
> I declared a array
>
> dim fee(1 to 2, 1 to 4) as string
> Dim i as integer
>
>
> Fee(1, 1) = "mgt"
> Fee(1, 3) = "mgt_mgt"
> Fee(1, 4) = "othersfees"
>
> For i = 1 To 4
> 'in order to evaluate this formula i need the fee name and client code
> StrFormula4 = "Fees(""" & Fee(1, i) & """,""" & Client& """)"
> Fee(2,i) = Evaluate(StrFormula4)
> Next i
>
> msgbox fee(2,i) ' I
> and once the formula evaluate I need the result.
>
>
>
> I do not know very well manipulating arrays; could someone help me on
> that
>
> Ina
>
>

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1