MyTetra Share
Делитесь знаниями!
Границы ячеек
Время создания: 16.03.2019 23:43
Текстовые метки: Границы ячеек, Borders, LineStyle
Раздел: !Закладки - VBA - Excel
Запись: xintrea/mytetra_db_adgaver_new/master/base/1520696224kg4ey8fvi8/text.html на raw.githubusercontent.com

границами также замени на


PureBasicВыделить код

1

2

3

4

5

6

7

8

9

10



 with range(cells(1,1),cells(R,6))

  .Borders(xlDiagonalDown).LineStyle = xlNone

  .Borders(xlDiagonalUp).LineStyle = xlNone

  .Borders(xlEdgeLeft).LineStyle = xlContinuous

  .Borders(xlEdgeTop).LineStyle = xlContinuous

  .Borders(xlEdgeBottom).LineStyle = xlContinuous

  .Borders(xlEdgeRight).LineStyle = xlContinuous

  .Borders(xlInsideVertical).LineStyle = xlContinuous

  .Borders(xlInsideHorizontal).LineStyle = xlContinuous

end with

















Dim rCellsBorders As Range

Set rCellsBorders = Range(.Cells(lngRowEnd, 1), .Cells(lngRowEnd + UBound(aNew) - 1, 14))

rCellsBorders.Borders(xlDiagonalUp).LineStyle = xlNone

rCellsBorders.Borders(xlDiagonalDown).LineStyle = xlNone

rCellsBorders.Borders(xlEdgeLeft).LineStyle = xlContinuous

rCellsBorders.Borders(xlEdgeTop).LineStyle = xlContinuous

rCellsBorders.Borders(xlEdgeBottom).LineStyle = xlContinuous

rCellsBorders.Borders(xlEdgeRight).LineStyle = xlContinuous

rCellsBorders.Borders(xlInsideVertical).LineStyle = xlNone

rCellsBorders.Borders(xlInsideHorizontal).LineStyle = xlNone

' если даты на верхней границе не совпадают

If .Cells(lngRowEnd, 1) <> .Cells(lngRowEnd - 1, 1) Then rCellsBorders.Borders(xlEdgeTop).Weight = xlMedium

' если даты на нижней границе не совпадают

If Len(.Cells(lngRowEnd + UBound(aNew), 1)) > 0 Then 'если есть данные ниже

If .Cells(lngRowEnd + UBound(aNew) - 1, 1) <> .Cells(lngRowEnd + UBound(aNew), 1) Then rCellsBorders.Borders(xlEdgeBottom).Weight = xlMedium

End If

Set rCellsBorders = Nothing

Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования