Hi
I am looking to modify a spreadsheet macro I have already written so that it uses customer numbers from 250 cell references to do a query for each customer. The results of each query populate into a table. Originally I only needed to query 50 customers so rather than write an array (not knowing much about these) I basically repeated the query across 50 variables (e.g. cust1 = Range("A1"), cust2 = Range("A2") etc). There was no loop, the script literally defined the variable and ran the query 50 times, selecting the range of the query by moving down 3 lines each time. I know, very long winded but it did the job.
To repeat the query in the macro 250 times causes the macro to report back it is too large so naturally I want to find out how to create an array. The thing is, I have Googled this quite heavily and although people have explained how to write an array, it never seems to suit my needs.
The spreadsheet has 250 queries so I intend to get it to move down this and populate the data in the query results into the table on the left of the screen. I need the query to move through the cells containing the customer numbers/ variables, but not to lose its place in the query sequence. Ideally I would like to modify what I already have rather than scrap the whole spreadsheet and start from scratch.
Any help would be much appreciated!
Bookmarks