Optimized code for Master Calendar

    Guys we are using a code from jgd  for master calendar. Thanks Josh here is a code for master calendar which is little bit optimized provided by Rob