Arrays and Macros

  • Thread starter Thread starter JDevsFan
  • Start date Start date
J

JDevsFan

Hello, I need help figuring out an array macro. I need to run a macro from
one page, check a cell on another page to see if it is a 1 or a 2, if it is a
1 I need to take a range of cells and store it to a macro for later use, and
if it is 2 store it in another macro for later use. Then take each of the
built array's and place them in a specific range of cells. I have tried
numerous things but nothing seems to be working for me. Any ideas or
thoughts from anybody?

Thanks,
 
Use VBA.
Define an array(s) where to keep your range(s).
Unless you need local arrays,
locate the array on a Module rather than on the worksheet code page, so you
can see if from every worksheet.
Copy the range, cell by cell to the array.
Get your cell value to answer the IF functions.
with
var = Workbooks("file.xls").Worksheets("sheet1").Cells(Row, Col).Value
or ActiveWorkbook.Worksheets("sheet1").Cells(Row, Col).Value

for the range you'll need some
dim c as cell
for each c in Workbooks("file.xls").Worksheets("sheet1").Range("RangeName")
or ....rows.count ... columns.count
Use Shift+F9 with ..Range("RangeName") and dig into the structure to see
what's available .
 

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

Back
Top