The invention includes a method for adjusting and controlling the airflow (6, 6A, 6B, 6C) in buildings such as stable facilities (1), based on an algorithm using a so-called adjusted Archimedes number where the result of the algorithm is used to regulate the airflow via a number of vents (5). With the invention, the airflow (6, 6A, 6B, 6C) in a stable (1) can continuously be controlled and regulated automatically and be kept optimun independently of changes in e.g. te temperature of surroundings or weather conditions.