OK here's the situation. I've created a workbook with 5 sheets in it.
The first sheet has columns for QTY, DESCRIPTION, PRICE and some other data, but those are the pertinent ones.
Based on the data entered, a labor invoice and several order forms are filled out. That is working correctly.
The issue I am having is I also need it to fill out a sheet named Contract. There are approximately 75 items on the main sheet, but the contract will never have more than 30 items.
I need to pull over only rows that have a non-zero value for QTY on the main sheet to the contract sheet, consecutively so that there are no blank rows until the data-set runs out of items with non zero QTY on the main sheet.
I.E.
if there are 15 non-consecutive rows on the main sheet with non-zero values for QTY, on the Contract sheet I need the first 15 rows out of 30 to pull over QTY, DESCRIPTION, PRICE from the main worksheet rows with non-zero QTY values.
I hope I am making sense.. It's got me stumped!
Thanks
EDIT: I just realized, I need to only pull data that has non zero values for QTY AND Contract Cost to the contract sheet! oops!
Try this. I assumed that you need pull data from main to contract. I hope i get your question right
Main worksheet :
Contract worksheet (Result)
Not sure if this is exactly what you're looking for but if you want to do it in a macro, I believe something like this would work:
This is not the cleanest macro cause I threw it together quick but it gets the job done and should be fast enough if your data isn't gigantic.
Consider the following screenshot. The left is the "Main" sheet, on the right is the "Contract" sheet.
Cell A2 on the "Contract" sheet has the formula
This is an array formula and must be confirmed with Ctrl+Shift+Enter. Then copy down and across.
Adjust cell references to reflect your scenario. Use ranges with row numbers. Don't use whole column references with array formulas.
Edit: to return only rows where in addition to existing conditions the cost is greater than 0, use this formula, also array-entered with Ctrl-Shift-Enter.