'Google Apps Script - onEdit for a range of cells?

I have defined a cell range named "datesRange"; I want to trigger based on any cell changes within that range and then call function(setStatus). Of course, this doesn't work! ... so, I need some help, please?

function onEdit (e) {


    // The variable "datesRange" is a global variable and defines cells B4:C8

    if(datesRange)
    {  
      Logger.log("Something has changed.");
      setStatus();
    } 

  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source