Detect frozen rows as headers

Take a look at this method. Maybe this would work for you.