Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
To whom it may concern,
I am trying to set a multi dimensional array that can be updated by all procedures then exported at the end. Does anyone know if I can do this ? ie Private Sub UPDATE1() Set MultiDimensionalArray(1,0) = "Frank" End Sub Private Sub UPDATE2() MultiDimensionalArray(1,1) = "Megan" End Sub Public Sub MultiDimensionalArray() End Sub Any help you may be able to provide would be much appreciated. Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
Brent,
a piece of advice: you'll save yourself a lot of frustration by understanding concepts. (a glance at your post shows you've smelled the milk but cant find the nipple . Freely translated from the Dutch language :) Can't see the diff between an array and a procedure ? Declare your array in the top of your code, then it becomes accessible to all procedures. Dim myArray(10,10) as string sub do1 myArray(2,2)="john" end sub sub get1 msgbox myArray(2,2) end sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool Brent McIntyre wrote: To whom it may concern, I am trying to set a multi dimensional array that can be updated by all procedures then exported at the end. Does anyone know if I can do this ? ie Private Sub UPDATE1() Set MultiDimensionalArray(1,0) = "Frank" End Sub Private Sub UPDATE2() MultiDimensionalArray(1,1) = "Megan" End Sub Public Sub MultiDimensionalArray() End Sub Any help you may be able to provide would be much appreciated. Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
I think you would need to declare it Public.
Public myArray(10,10) as string sub do1() myArray(2,2)="john" end sub sub get1() msgbox myArray(2,2) end sub to see it in other modules. -- Regards, Tom Ogilvy "keepitcool" wrote in message ... Brent, a piece of advice: you'll save yourself a lot of frustration by understanding concepts. (a glance at your post shows you've smelled the milk but cant find the nipple . Freely translated from the Dutch language :) Can't see the diff between an array and a procedure ? Declare your array in the top of your code, then it becomes accessible to all procedures. Dim myArray(10,10) as string sub do1 myArray(2,2)="john" end sub sub get1 msgbox myArray(2,2) end sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool Brent McIntyre wrote: To whom it may concern, I am trying to set a multi dimensional array that can be updated by all procedures then exported at the end. Does anyone know if I can do this ? ie Private Sub UPDATE1() Set MultiDimensionalArray(1,0) = "Frank" End Sub Private Sub UPDATE2() MultiDimensionalArray(1,1) = "Megan" End Sub Public Sub MultiDimensionalArray() End Sub Any help you may be able to provide would be much appreciated. Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
Tom,
I should have mentioned "to all procedures within this module". The point wasn't whether to declare it public or private but rather to declare it (at module level) and not confuse it with Sub MyArray(). keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Tom Ogilvy" wrote: I think you would need to declare it Public. Public myArray(10,10) as string sub do1() myArray(2,2)="john" end sub sub get1() msgbox myArray(2,2) end sub to see it in other modules. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
The OP said
I am trying to set a multi dimensional array that can be updated by all procedures I had recollected this to be multiple modules and thus my suggestion - however, going back and reading it specifically, there is no reason to believe that is what was meant. -- Regards, Tom Ogilvy "keepitcool" wrote in message ... Tom, I should have mentioned "to all procedures within this module". The point wasn't whether to declare it public or private but rather to declare it (at module level) and not confuse it with Sub MyArray(). keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Tom Ogilvy" wrote: I think you would need to declare it Public. Public myArray(10,10) as string sub do1() myArray(2,2)="john" end sub sub get1() msgbox myArray(2,2) end sub to see it in other modules. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public Array
Thanks guys your information has helped, I guessed this is what I needed
to do but once again I had trouble locating help on this actual method. Just to clear up the confusion, I do need to be able to see the array from other modules, so thanks Tom for your help there. Keep up the good work ! Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect public sub | Excel Discussion (Misc queries) | |||
public variables | Excel Discussion (Misc queries) | |||
Public variables | Excel Discussion (Misc queries) | |||
Public Variables | Excel Discussion (Misc queries) | |||
public variable | Excel Programming |