I created a database in an Excel workbook. I named this workbook: "Model".
The sheets are named after a specific model in that sheet. For example, Worksheet("Model 5") contains data for our Model 5 product.
Each week, I get an Excel list of models that potential customers want to see. My goal is to run a macro that
1) Goes through each value on the customer's list
2) Compare this to the Workbook("Model") sheet names.
3) If there is a match between the cell value and sheet name, then copy data from that worksheet.
4) Then paste this data into the FinalRow of a separate worksheet.
I’m attempting to do this with a “for each” and loops. However, I am stuck at step 3. How do I word the code for it to copy data from that worksheet? Also, does anyone have a reference to an array code that performs a similar function?
I am using Excel 2007. My code at step 3 looks like this:
For each ws in worksheets
If cells(i, 1).Value=ws.Name, then ??
Thanks in advance.
The sheets are named after a specific model in that sheet. For example, Worksheet("Model 5") contains data for our Model 5 product.
Each week, I get an Excel list of models that potential customers want to see. My goal is to run a macro that
1) Goes through each value on the customer's list
2) Compare this to the Workbook("Model") sheet names.
3) If there is a match between the cell value and sheet name, then copy data from that worksheet.
4) Then paste this data into the FinalRow of a separate worksheet.
I’m attempting to do this with a “for each” and loops. However, I am stuck at step 3. How do I word the code for it to copy data from that worksheet? Also, does anyone have a reference to an array code that performs a similar function?
I am using Excel 2007. My code at step 3 looks like this:
For each ws in worksheets
If cells(i, 1).Value=ws.Name, then ??
Thanks in advance.