Hi and welcome to the forum.
Using a macro to accomplish this task seem rather OTT, particularly one which involves a loop. Loops are inherently slow and should only be used if there's no standard Excel functions that you can use. In this case you can use simple COUNTIF() and COUNTA() functions.
First create a dynamic range name which will adjust automatically to cater for any number of rows that you may add. I created one called
'Data_YN' and defined this in the name manager as
Now all you need is to put this formula in N1, or anywhere for that matter
Make sure when you define the name that the Scope is set to Sheet level. Then assuming you copy the sheet to create the other 23 the same name will be present on each one but scoped to the sheet its on. If the 24 sheets are already in place then put the following line of code in a macro that iterates through all the sheets
late edit...just spotted an error. ....wait one... Now Corrected
Bookmarks