I guess the problem of "runnning the code no matter which cell is selected" can be solved by naming.
1-Name the header rows of your each table. For example for the primary table's header, select the 6'th row end name it as "HeaderPrimary"
; than name the empty row where there is currently a button, namely the row numbered 25 as "EndPrimary"
The first two lines in the code below will get you the row number of those rows.
The last line of code will give you the row number of the first empty row, in the first column, between the headerrow and endrow.
Do the same to the Secondary table.
Activating the macro with the button
There is something wrong with the two buttons present on your sheet, I don't know what.
I can't right click them!
Anyway, just add a new button and associate it with your macro. (there shouldn't be any problems with that, I tried).
Cheers,
Bookmarks