berikut adalah tampilan grid dan hasil export nya :
Sub i_Export()
On Error Resume Next
Dim objExcel As Object
Dim i As Integer
Dim j As Integer
If gridReminder.Rows > 1 Then
Set objExcel = CreateObject("excel.application")
With objExcel
.workbooks.Add
.Visible = True
For i = 0 To gridReminder.Rows
For j = 3 To gridReminder.Cols
.cells(i + 1, j - 2) = gridReminder.TextMatrix(i, j - 1)
Next j
Next i
.range(.cells(1, 1), .cells(gridReminder.Rows, gridReminder.Cols)).borders.LineStyle = 1
.range(.cells(1, 1), .cells(1, gridReminder.Cols)).interior.colorindex = 56
.range(.cells(1, 1), .cells(1, gridReminder.Cols)).Font.colorindex = 2
.range(.cells(1, 1), .cells(1, gridReminder.Cols)).Font.Bold = True
.cells.Select
.cells.entirecolumn.autofit
End With
End If
Set objExcel = Nothing
End Sub
0 komentar:
Posting Komentar