How to update header text in hook_views_pre_render
Well the important thing is to narrow down the particular view display you want to affect. Then you can look at the header text later. I have the following similiar code ... you should be able to use views_pre_render fine, I don't use that here:

function MYMODULE_views_post_execute(&amp;$view) {
  if ($view-&gt;name == 'migration_audits') {
    $drupal_nids = array();
    if (count($view-&gt;result)) {
      foreach ($view-&gt;result as $i =&gt; $node) {
        $drupal_nids []= $node-&gt;nid;
      }
    }
   $sql = " ... ";
   $result = db_query($sql, array(':drupal_nids' =&gt; $drupal_nids));
    $output = '';
    foreach ($result as $course) {
      #dpm($course);
      $title = html_entity_decode($course-&gt;course_title, ENT_COMPAT, 'UTF-8');
      $instructors = html_entity_decode($course-&gt;instructor, ENT_COMPAT, 'UTF-8');
      $output .= "&lt;div class=\"entry\"&gt;$course-&gt;quarter $course-&gt;year - $title Instructors:&amp;nbsp;$instructors&lt;/div&gt;";
    }


    $my_values = "&lt;style type=\"text/css\"&gt;div.legacy_values { background-color: pink;} div.legacy_values div.entry { padding-bottom: 5px; }&lt;/style&gt;&lt;div class=\"legacy_values\"&gt;$output&lt;/div&gt;";
    $view-&gt;display['page']-&gt;handler-&gt;handlers['header']['area_1']-&gt;options['content'] = $my_values;
    $view-&gt;display['page']-&gt;handler-&gt;handlers['header']['area_1']-&gt;options['empty'] = 0;
  }
}


You can also do like $view-&gt;display[$view-&gt;current_display] usually as a safe none hard coded approach. Note that the global header regions are given names such as area_1, area_2 etc as a convention by Views. I also tell Views the area is now not empty.