Constructing Inner and Outer Loops in Excel VBA

G

Guest

Hi.

I was wondering how I could loop through a matrix of information, populate a
row in another worksheet with the values I pulled from the matrix, and then,
continue looping through other matrices, i.e.I'm looking for loop-within-loop
information,

for eg.

Matrix 1
sales = 50

profits = 60 debts = 30

Matrix 2
sales = 34

profits = 67 debts = 32

I want to construct an inner loop that can sort within each matrix, delete
any row with spaces, pick up each data point from different cells, store them
in one row in another worksheet, and then close that loop and have an outer
loop that will repeat the same action for each matrix, storing the values of
each matrix in a different row in the new worksheet.

I know it probably is a little complicated, but I was just hoping that
someone could help me out with the trickier aspects of the loop.

Thanks for reading this far, I appreciate it

Naz
 
T

Tom Ogilvy

for i = 1 to 10
for j = 1 to 20
for k = 1 to 5

next k
next j
next i

shows nested loops.
 

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