Bolding a specific part of cell

前端 未结 4 2152
梦毁少年i
梦毁少年i 2021-02-13 20:39

I have a cell that is referenced as =\"Dealer: \" & CustomerName. CustomerName is a dictionary referenced name. How could I go along of bolding only \"Dealer:\"

4条回答
  •  走了就别回头了
    2021-02-13 21:16

    Instead of referencing you could simply obtain the cells and place it in a variable, and basically append it. From here you can use the .font.bold functionality to bold a specific part. Lets say on page 2, you have "Dealer: " in cell a1, and "Josh" in b1. Here is an example how it could be done:

    Worksheets("Sheet1").Cells(5, "a") = Worksheets("Sheet2").Cells(1, "a") & Worksheets("Sheet1").Cells(1, "b")
    Worksheets("Sheet1").Cells(5, "a").Characters(1, 7).Font.Bold = True 'Bolds "dealer:" only.
    

提交回复
热议问题