一个execl初雪者的问题,怎样给一个单元格画线?关键是要动态显示
我的程序是这样的
With rstserver
If .State = adStateOpen Then .Close
.ActiveConnection = gcnnReport
.CursorLocation = adUseServer
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Source = "select * from gsgl_gl "
.Open
.MoveFirst
irow = 4
icol = 7
While Not .EOF
icol = icol - 5
strselect = "e" & Trim(Str(irow)) & ":d" & Trim(Str(irow))
MyXL.Sheets("sheet1").Range(strselect).Select
MyXL.Sheets("sheet1").Range(strselect).Activate
MyXL.Sheets("sheet1").Cells(irow, icol) = .Fields("date")
icol = icol + 1
MyXL.Sheets("sheet1").Cells(irow, icol) = .Fields("times")
'为获取事故地点,关连事故发生的站名
dd = .Fields("station_name") & "站" & .Fields("direction_name") & "方向" & .Fields("mark") & "k"
icol = icol + 1
MyXL.Sheets("sheet1").Cells(irow, icol) = dd
icol = icol + 1
MyXL.Sheets("sheet1").Cells(irow, icol) = .Fields("type_name")
icol = icol + 1
MyXL.Sheets("sheet1").Cells(irow, icol) = .Fields("summary")
icol = icol + 1
MyXL.Sheets("sheet1").Cells(irow, icol) = .Fields("remark")
.MoveNext
irow = irow + 1
Wend
End With
我现在已经能数据能插入到excel里了,我想在插入数据的同时也能给数据画上表格,应该怎么做呢