How can I reference to another array?

L

Levan Jgarkava

Hi,

When I'm trying to assign one array to another the data is actually copied
to another array, but I don't need to make a copy of array, I want just
reference to array (so that when I'll change elements in one array, another
array element also will change).
How can I do this?
 
J

Jeff Johnson [MVP:VB]

Please don't anyone answer this question or any others until this person
learns some proper Netiquette and stops this ridiculous crossposting.
 
L

Levan Jgarkava

I'm sorry if I broke som erules of newsgroups :(
I didn't know that it's not allowed. Please give me URL of rules and I will
not do it any more...
once again excuse me for caused inconvenience
 
D

Doug Robbins - Word MVP

Personally, I have no problem with cross posting. It's the people that
multipost that are the problem.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

Set the element of one array equal to the element of the other

Dim array1 As Variant, array2 As Variant, i As Long

array1 = Array(10, 20, 30)
ReDim array2(UBound(array1))
' Display the first element in array1
MsgBox array1(0) ' It's 10
For i = 0 To UBound(array1)
array2(i) = array1(i)
Next i
' Change the first element in array2
array2(0) = array1(1)
' Set the first element in array1 equal to the first element in array2
array1(0) = array2(0)
' Display the first element in array1
MsgBox array1(0) ' Now it's 20


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

J French

Please don't anyone answer this question or any others until this person
learns some proper Netiquette and stops this ridiculous crossposting.

Surely crossposting is Ok
- but he has posted to a heck of a lot of NGs
- maybe that's what you mean

We really need a bit more info on what the OP is trying to do
- the answer might be simplistic - like pass the Array ByRef
- or involve a nasty hack
 
R

Rick Rothstein

Surely crossposting is Ok
- but he has posted to a heck of a lot of NGs
- maybe that's what you mean

Of course crossposting is OK... but only if it is done sensibly.

Really now.... Office/VBA.... VB.... winapi.... BUGS!!?!!???

I'm thinking those last two don't fit the question very well.<g>

Rick
 
B

Bob O`Bob

Rick said:
Of course crossposting is OK... but only if it is done sensibly.

Really now.... Office/VBA.... VB.... winapi.... BUGS!!?!!???

I'm thinking those last two don't fit the question very well.<g>


if you'll closely examine the original post, it gets even worse:

% Newsgroups: microsoft.public.office.developer.vba,microsoft.public.ru.vb,microsoft.public.vb.bugs,microsoft.public.vb.enterprise,microsoft.public.vb.general.discussion,microsoft.public.vb.syntax,microsoft.public.vb.winapi,microsoft.public.word.vba.beginners,m

Notice what's after the eighth comma...



Bob
 
L

Levan Jgarkava

2ALL: Look, I'm really sorry if I make people uncomfortable with this
crossposting... I didn't know that it will be so bad, so, i'm gonna
apologize for everything...

Best Regards,
Levan Jgarkava
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top