Передать в качестве параметра объект Excel |
Private Sub SetGrid(ExcelRange As Object) On Error GoTo ErrorBlock ExcelRange.Borders(xlDiagonalDown).LineStyle = xlNone ExcelRange.Borders(xlDiagonalUp).LineStyle = xlNone With ExcelRange.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With ExcelRange.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With ExcelRange.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With ExcelRange.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End With ErrorBlock: MsgBox Err & " " & Err.Description Err.Clear Exit Sub End Sub
SetGrid xlSheet.Range(xlSheet.Cells(4, 1), xlSheet.Cells(rst.RecordCount + 4, 3))
http://www.sql.ru/forum/1070782/peredat-v-kachestve-parametra-obekt-excel
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |