Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Excel公式更改单元格背景颜色和/或设置文本粗体_Html_.net_Excel_Vba - Fatal编程技术网

Html Excel公式更改单元格背景颜色和/或设置文本粗体

Html Excel公式更改单元格背景颜色和/或设置文本粗体,html,.net,excel,vba,Html,.net,Excel,Vba,我有一个.net应用程序,它从简单的字符串变量生成excel,其中每个单元格的值如下所示: For iCol = 0 To Cols.Rows.Count - 1 str &= Trim(Cols.Rows(iCol)("capt")) & vbTab Next 我正在寻找通过excel公式更改单元格背景和/或设置文本粗体的方法 差不多 str &= "=<b>" str &= Trim(Col

我有一个.net应用程序,它从简单的字符串变量生成excel,其中每个单元格的值如下所示:

For iCol = 0 To Cols.Rows.Count - 1
                str &= Trim(Cols.Rows(iCol)("capt")) & vbTab
            Next
我正在寻找通过excel公式更改单元格背景和/或设置文本粗体的方法

差不多

str &= "=<b>"
str &= Trim(Cols.Rows(iCol)("capt"))
str &= "</b>"
str&=“=”
str&=Trim(列(iCol)(“船长”))
str&=“”

str&=“p bgcolor=“+”color”+“>”
str&=Trim(列(iCol)(“船长”))
str&=“

宏或条件格式不是选项。

您正在查找和属性

For iCol = 0 To Cols.Rows.Count - 1
    str &= Trim(Cols.Rows(iCol)("capt")) & vbTab
    Cells(row, iCol).Font.Bold = True
    Cells(row, iCol).Interior.Color = ColorConstants.vbCyan
Next  
For iCol = 0 To Cols.Rows.Count - 1
    str &= Trim(Cols.Rows(iCol)("capt")) & vbTab
    Cells(row, iCol).Font.Bold = True
    Cells(row, iCol).Interior.Color = ColorConstants.vbCyan
Next