View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_4_] Alan Beban[_4_] is offline
external usenet poster
 
Posts: 171
Default Finding ranges in an array, cut and paste also.

This seems kind of garbled. It's hard to follow what's supposed to refer
to myarray and what's supposed to refer to myarray1. In the first two
lines both are declared as myarray. What is myarray supposed to be
loaded with? What's the significance of "column 3 in myarray; what if
target is in some other column?

Alan Beban

Tom Ogilvy wrote:
You mean a vba array?

Dim myarray(1 to 200,1 to 8) as Long
Dim myarray()

for i = 1 to 2000
if myarray(i,3) = "target" then
mrow = i
exit for
end if
Next
Redim myarray1(1 to mrow, 1 to 8)
for i = 1 to mrow
for j = 1 to 8
myarray1(i,j) = myarray(i,j)
Next
Next