I have a small problem I'm sure is easy finger/Brain trouble on my side. I have a variable array DistArray(5, 30) located in a UserForm which works fine, but I wish to pass this data back to an array in a module and I'm having no success.
It's declared as follows in the UserForm
<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> DistArray(5, 30) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> DistArray1(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray2(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray3(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray4(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray5(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray6(5, 1)</FONT>
In the Module called Create_UserData I have declared a procedure as below
<font face=Courier New><SPAN style="color:#00007F">Public</SPAN> <SPAN style="color:#00007F">Sub</SPAN> AR_Store()
<SPAN style="color:#00007F">Dim</SPAN> Ar_Str(5, 30) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN></FONT>
To pass this data I have used the following code, but It doesn't recognise the array name. Does anyone know why??
<font face=Courier New><SPAN style="color:#00007F">For</SPAN> P = 0 <SPAN style="color:#00007F">To</SPAN> 4
<SPAN style="color:#00007F">For</SPAN> M = 1 <SPAN style="color:#00007F">To</SPAN> 30
Create_UserData.AR_Store(P, M) = DistArray(P, M)
<SPAN style="color:#00007F">Next</SPAN> M
<SPAN style="color:#00007F">Next</SPAN> P</FONT>
Regards
DaveFish
It's declared as follows in the UserForm
<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> DistArray(5, 30) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> DistArray1(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray2(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray3(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray4(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray5(5, 1)
<SPAN style="color:#00007F">Dim</SPAN> DistArray6(5, 1)</FONT>
In the Module called Create_UserData I have declared a procedure as below
<font face=Courier New><SPAN style="color:#00007F">Public</SPAN> <SPAN style="color:#00007F">Sub</SPAN> AR_Store()
<SPAN style="color:#00007F">Dim</SPAN> Ar_Str(5, 30) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN></FONT>
To pass this data I have used the following code, but It doesn't recognise the array name. Does anyone know why??
<font face=Courier New><SPAN style="color:#00007F">For</SPAN> P = 0 <SPAN style="color:#00007F">To</SPAN> 4
<SPAN style="color:#00007F">For</SPAN> M = 1 <SPAN style="color:#00007F">To</SPAN> 30
Create_UserData.AR_Store(P, M) = DistArray(P, M)
<SPAN style="color:#00007F">Next</SPAN> M
<SPAN style="color:#00007F">Next</SPAN> P</FONT>
Regards
DaveFish