Hi

The question worksheets is filled with data on 5 rows and 3 columns.
I'd like to have this data stored in an Array. For testing purpose, I
want to test if the loop is "reading" the data with an integer "tmp"
that should return the number of cells filled in with data.

 Set wkb = ThisWorkbook
 Set wks = wkb.Worksheets("questions")


  For i = 0 To wks.Cells(i + 1, 1 = ""
    For j = 0 To wks.Cells(i + 1, j + 1) = ""
      tmp = tmp + 1
    Next j
  Next i

Why aren't Loop j and i looping?



Another question :

Is this possible to redim an array in a 2d for loop :

dim SomeArray() as variant
redim SomeArray(0,0) 'A

for i = 0 to MAXL
for j = 0 to MAXC
SomeArray(i,j) = cells(i+1,j+1)
redim preserve SomeArray(i,j+1)
next j
redim preserve SomeArray(i+1,j) 'j has still MAXC as value
next i

I understand it's not making sense since MAXL and MAXC could be
declared in A.

Back to the previous question it would make sense to redim a 2d array
in a for loop until a cell is empty in the column and a cell is empty
in the lines.

Thanks for your precious help,

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to