Hello,
I've got a doozy here.
I have multiple workbooks that contain varying amounts of worksheets within each book.
In each workbook, I have a "Summary" sheet that I need to automatically gather data from a specific range ("A5:G1000") from each worksheet. This represents a table of data 7 columns long.
The problem is, the data within each sheet ("A5:G1000") that I need to copy to the "Summary" sheet, could consist of only 2 rows of data, or it could be 100 rows or data, or even eventually, 1000 rows of data.
The end goal is to have a table on the "Summary" sheet ("A?:G?") that is summarizing the data from the varying sized tables of information from every other sheet in the workbook.
I have a programmatic list of actions below that I need this VBA to achieve.
1) Find each worksheet in the workbook not named "Summary", and then loop through the range ("A5:G1000") looking for any value that is Not Blank, or greater than zero. > 0.
2) Copy all rows of data from range ("A5:G1000") that are not blank.
3) Paste these values into the "Summary" sheet, starting with the first blank cell from ("A2") down. ("A1:G1") is my header row.
4) Lastly, this collection table on the "Summary" sheet needs to overwrite itself automatically whenever the workbook is saved.
One thing to note is that the worksheets within each workbook are ever changing. Meaning, new worksheets will be added to each workbook overtime.
Now to share what I've done so far. Here, I've basically been able to achieve what I'm looking for except that I can only get 1 cell to copy over to the "Summary" sheet.
I need the entire range of data ("A5:G1000") that is not blank, or greater than zero, to copy over, not just ("A5") as I have shown below.
Also, I'm showing this Sub being attached to a CommandButton for testing purposes, but I would like for this to happen automatically in the background without my end users needing to intervene.
Thank you kindly to anybody who is able to help me expand this code to include a set number of columns in a range with varying rows of data.Please Login or Register to view this content.
-Mike in Cali
Bookmarks