I have a sheet I work on every morning that is unique with its data and how much there is. What I would like to do, is have a VBA code that can loop through blanks cells/rows in my sheet and add a formula in those columns, then copy & paste basic info from the above row. With bonus points if you can also include code to format it in the first place from its original state. I've attached an example file of what it should look like and its original format to hopefully show what I'm trying to explain.
The "unformatted" sheet is the technical original that I have after some basic formatting. What I will do from there is split up rows of SUM (Column AB) that match its corresponding CUSIP (Column J) and add borders to the net amounts (Column X). You can see what this looks like in the "PartialFormat" sheet. From there, I will manually add a sum formula then copy and paste the matching data to complete it which the "Finished" sheet will show. If you could get it to work from the PartialFormat sheet, that would be great as it's usually not much of an issue to do it myself. If you could get it to work from its raw state (Unformatted sheet) that would be greatly appreciated!
To give more details on what is needed. As previously explained, after basic formatting and manual changes. I will get it like the "PartialFormat" sheet. I have heavily cut it down but on average it will have about 100-200 rows of data with more occasionally. What I would like is at its simplest, a VBA code that will take each blank row in the sheet after I partially format it, and add a SUMIFS formula (below or a better one if you know it) to column X. Then in that same blank row, add a "Y" to column AB, then copy & paste the Settlement Date & CUSIP (Column G & J) from the above row since they will also be unique. And have it Loop or check each row until it reaches the end of the data or row 499 as row 500+ I will put data that's used for conditional formatting.
Formula:
=SUMIFS(X:X,AB:AB,"SUM",J:J,J2)
BONUS: If you can get it to work from it's unformatted state, that would be incredible! What it would need to do is check for "SUM" entries in column AB. Then match them to their CUSIP's in column J and add a new blank row when the CUSIP changes. It would then take the same info and in column X. Create a thick outside border of those entries and the new blank row, and a double bottom border above the SUM or new blank row. (Final example in the "Finished" sheet of how it should work).
If you need more details, I'll try my best to explain it further!
Bookmarks