PDA

View Full Version : join multidimensional array vba



shs91
02-26-2016, 12:09 PM
Hey Guys,

I have a small problem, that I hope you guys can help me with:

I have made a two dimiensional array (eg. data(i,j)) and I want for each i join the j's, if that makes sense. For example lets say I have the following table;

ab bc
cd de
ef fg

And I read this into the array eg,
for i=1 to 3 (rows)
for j=1 to 2 (columns)
data(i,j)=cells(i,j)
next
next

Now I want to join only over the j's like data (i,1 to 2), so I get the following output ;
abbc
cdde
effg

Does anybody know how to do this ?


Br,
Simon,

snb
02-26-2016, 01:34 PM
sub M_snb()
sn=range(A1:B3)

for j=1 to ubound(sn)
msgbox join(application.index(sn,j),"")
next
End Sub

see also: http://www.snb-vba.eu/VBA_Arrays_en.html