// Apply borders to the Sales data and headers
oResizeRange := oWS.Range['E1:' + Chr(Ord('E') + iNumQtrs - 1) + '6'];
oResizeRange.Borders.Weight := xlThin;
// Add a totals formula for the sales data and apply a border
oResizeRange := oWS.Range['E8:' + Chr(Ord('E') + iNumQtrs - 1) + '8'];
oResizeRange.Formula := '=SUM(E2:E6)';
oResizeRange.Borders.Item[xlEdgeBottom].LineStyle := xlDouble;
oResizeRange.Borders.Item[xlEdgeBottom].Weight := xlThick;