А если нужно использовать только нижнюю толстую линию выделения под итогами. И толстую правую линию выделения в каждом столбце данных. Пробовал сделать, по ошибке вылетаю. Кинул пример для наглядности.
Код
begin
XLApp.DisplayAlerts := False; //отмена ругани экселя
iFirstRow := 10; // начало поиска
repeat
CurrValue := XLApp.Cells.Item[iFirstRow, 1].Value;
iCurrentRow := iFirstRow + 1;
while (CurrValue <> Unassigned) and
(XLApp.Cells.Item[iCurrentRow, 1].Value = CurrValue) do
begin
Inc(iCurrentRow);
end;
//закрашивание строк "итого"
XLApp.Range[Format('B%d', [iCurrentRow-1]), GetCellAddress(ColCount, iCurrentRow-1)].Interior.Color:=rgb(255,255,153);
//XLApp.Range[Format('B%d', [iCurrentRow-1]), GetCellAddress(ColCount, iCurrentRow-1)].Borders.xlEdgeBottom.LineStyle := xlContinuous;
//XLApp.Range[Format('B%d', [iCurrentRow-1]), GetCellAddress(ColCount, iCurrentRow-1)].Borders.xlEdgeBottom.Weight := xlMedium;
//Report.Range[Format('B%d', [iCurrentRow-1]), GetCellAddress(ColCount, iCurrentRow-1)].Borders.Weight := xlMedium;
//группировка значений
XLApp.Range[ Format('A%d:A%d', [iFirstRow, iCurrentRow - 1]) ].MergeCells := True;
XLApp.Range[ Format('A%d:A%d', [iFirstRow, iFirstRow]) ].HorizontalAlignment := xlCenter;
XLApp.Range[ Format('A%d:A%d', [iFirstRow, iFirstRow]) ].VerticalAlignment := xlCenter;
iFirstRow := iCurrentRow;
until CurrValue = Unassigned;
end;