如何使文本的一部分加粗

我在vba中有以下function:

Function ConcatinateAllCellValuesInRange(sourceRange As Excel.Range) As String Dim finalValue As String Dim cell As Excel.Range i = 0 For Each cell In sourceRange.Cells i = i + 1 Rzad = cell.Row finalValue = finalValue & CStr(i) & ". " & CStr(Sheets(1).Cells(Rząd, 6)) & "/" & CStr(Sheets(1).Cells(Rząd, 7)) & ": " & Format(cell.Value, Bold) & "; " & vbCrLf Next cell ConcatinateAllCellValuesInRange = finalValue End Function 

我想使粗体文本的一部分,但“格式(cell.Value,粗体)”不起作用。 你能提出一个解决scheme吗?

尝试:

 cell.Font.Bold = True 

如果你想整个单元格大胆。

如果您只想使单元格的一部分为粗体,请参阅: excel vba:将string的一部分设为粗体