Function inputColumnValue(SheetName,TestCaseCode,actualvalue,statuse)
Dim TestCaseFilePath'测试用例文件路径
TestCaseFilePath="\PM3_TestCase\TestCasesDetails.xls"
Dim M
Dim rnum'行号
Dim cnum'列号
Set oExcel = CreateObject("Excel.Application")
Set oWorkbook = oExcel.Workbooks.Open(getFolderTestDirPath& TestCaseFilePath)
Set oSheet = oWorkbook.Worksheets(SheetName)
M = oSheet.UsedRange.Count
Set oCell = oSheet.Range("B" & M).Find(TestCaseCode)'查找B列用例编号为TestCaseCode的行
If oCell Is Nothing Then
GetDataCoordinate = "Not Found"
Else
rnum = oCell.Row
oSheet.cells(rnum,9)=actualvalue‘写入数据到第rnum行第九列
oSheet.cells(rnum,10)=statuse'写入数据到第rnum行第十列'oSheet.cells(rnum,10) 如何设置字体颜色为红色
'******************问题已解决**********************
此处设置单元格字体颜色
oSheet.cells(rnum,10).Font.Color=vbred
'************************************************
End If
oWorkbook.Close
oExcel.Quit
Set oCell = Nothing
Set oSheet = Nothing
Set oWorkbook = Nothing
Set oExcel = Nothing
End Function作者: 吼吼哈哈 时间: 2013-9-3 20:55
顶作者: fsweicaixia 时间: 2013-9-7 09:55
为何没反应那作者: fsweicaixia 时间: 2013-9-7 09:56
顶起来作者: fsweicaixia 时间: 2013-9-7 10:16
oSheet.cells(rnum,10).Font.Color=vbred 此问题已解决。