
Originally Posted by
padra2001ca
Thank you both for your help. Both solutions posted worked but I'm looking to keep the BOMs on separate sheets as that is how the data is currently stored. Also, jindon's solution gives me an out of range message when I add or delete sheets. Also, I would like to show all the parts in the "All Parts" worksheet whether they are 0 or not as I will pulling that data into another workbook.
In addition to this, the schedule data may not be stored in such a perfect manner. The data may start in a lower row and column. How would I modify the macro if that were the case? I'm a bit new to vba but I have a background in java/c++.
Thanks again!
Try this attachment. I've put in some code so that if the data starts in a different row or column, or the columns are spaced apart from each other (this applys to all the sheets) it will still run as normal. I moved some data around on your spread sheet to show you what I mean (See sheet Schedule and All parts). This happens because I've got the macro searching for headers (widget, qty to build, part number e.g.). If any of the headers change on any of the sheets, the macro will not run and a message box should appear telling you that a specific header could not be found on a specific sheet. If you do choose to change the headers on the sheets, you must change the below part of the macro to reflect the changes made on the sheet.
Also, the data must start directly below the headers for the macro to run. If you would like a blank row (or two) between the data and the header, you must change the below code.
If you got any questions or need me to specify something, please let me know.
Bookmarks