Hi,
Hope this is right forum for this.
I'm trying to write my first function.
Here's my brief
I Have a couple of thousand workbooks (production orders actually, in case you're wondering why so many) which are layed out identically.
In each book there is a sheet called "PO P1"
There is a range (used row by row and layed out as per the attached file).
The range is "P15:S48" There is also an order number in cell E5 of the same sheet.
It represents sizes and quantities of components (row by row) with the size data entered in millimetres.
I'm trying to write my first function which needs to:
- Find the cubic area in metres of each row then multipy that result by the quantity for that row to give total cubic metres for that row.
- Do this for each row with data in it (not all rows in the range are used)
- Then sum all row totals with a grand total for total cubic metreage for that range.
I'm not sure it's possible, (though I think I've read this). but I would then like to apply that process to each workbook in a given folder with each line identified by it's order number
(cell E5 of the same sheet).
Hopefully, this will then allow me to end up with a results sheet (current new book probably when code is run) with 2 columns showing Order number and next to that the total cubic meterage result.
I have tried to declare the elements but to be honest I'm out of my depth understanding what should be declared as what.
Never done anything like this from scratch so getting my "As Ranges" and As Sheet mixed up. let alone actually getting a result at the end of it!
Only last detail which may be relevant is that sometimes users have entered shapes or other line drawings in the blank areas of this section which may mean some of rows may be corrupted in regards to being relevant to the task at hand. Is there anyway that some error trapping could occur which could evaluate if each row appears complete before it is included / passed from the funcion?
I appreciate that this is a big ask but having to try and extract this information from all these books retrospectively is a monumental task and costings and decision making timeframes are not helping me in the slightest.
Any help will be humbly and graciously accepted.
Dean
Bookmarks