Hi Guys
I'm new to the Forum.
I have an Excel table of some 600+ records and have devised a macro (Excel_Macro_1) which reformats the table, sorts it on one column into three categories ‘blank’, ‘Air’ and ‘emag’ and adds three functions to count the number of records in each category (abridged version of table attached as Example_1).
I require the macro then to insert a block of 5 further blank rows to fall into the ‘blank’ category. I’ve tried inserting 5 rows as the last 5 rows in the ‘blank’ category by selecting the first 5 rows in the ‘Air’ category and, from the context menu, selecting ‘insert’. By doing so, the addresses of the inserted rows are hard coded into the macro which becomes a problem if the ‘blank’ category contains more records than when the macro was first/last run, resulting in the blank rows being spread between two locations in the table.
I need somehow to instruct the macro to insert the 5 rows by reference to ‘the first row which is not blank’ but achieving this is beyond my Excel knowledge.
For the purposes of this query, sensitive data have been removed from the attached Excel file. The macro code however reflects the original spreadsheet upon which it was based.
I would appreciate some help.
PeterWB
Excel_Macro_1.docxExample_1.xlsx
Bookmarks