0
A
回答
2
可以使用下面的示例VBA代碼段(字體在斜體)實現它:
Worksheets("Sheet1").Range("A1").Font.Italic = True
或設置斜體/粗體類似如下:
Worksheets("Sheet1").Range("A1").Font.FontStyle = "Bold Italic"
(re:https://msdn.microsoft.com/en-us/library/office/ff194438.aspx)
在更普遍的情況下,您可以在Excel Cell
或應用該技術整個文本只是它的一部分,如下圖所示:
'demonstrate font Italic/Bold applied to part of Excel cell
Sub DemoFontItalicBold()
Range("A1").Value = "This is Just a Sample Text"
'display "A1" 4 initial chars in bold/italic typeface
Range("A1").Characters(1, 4).Font.FontStyle = "Bold Italic"
'set the word "Sample" in Italic typeface
Range("A1").Characters(WorksheetFunction.Find("Sample", Range("A1").Value, 1), Len("Sample")).Font.Italic = True
'set the word "Text" in bold typeface
Range("A1").Characters(WorksheetFunction.Find("Text", Range("A1").Value, 1), Len("Text")).Font.Bold = True
End Sub
相關問題
- 1. <style type =「text/javascript」>是否有用?
- 2. 是否有一個相當於bash的<()sh
- 3. mail.log相當於php <5.3
- 4. Pythonic相當於./foo.py <bar.png
- 5. <<是一個C++的事情 - 相當於Java
- 6. 是否存在相當於<xs:choice>的「選擇」Java註釋?
- 7. 什麼是htac相當於<meta http-equiv =「Content-Type」content =「text/html; charset = utf-8>
- 8. 訪問相當於C#列表的VBA <T>
- 9. VBA相當於在C#中列出<T>
- 10. OpenSL ES中是否有與OpenAL <alc.h>相當的功能?
- 11. <text>與<span>
- 12. jQuery是否具有相當於Dojo的增強功能<select>?
- 13. 是否有一個相當於<c:url/>的JSTL EL(表達語言)
- 14. 對於WPF,是否有IMarkupExtension <T>?
- 15. 是否<input>沒有<form>?
- 16. 什麼是JavaScript相當於寫的「如果</p> <p>不是」
- 17. 什麼是<script type =「text/javascript」><!--mce:0--></script>?
- 18. 使用<g:submitbutton>是否有益於<input>或<button>?
- 19. 是否有`sh`等價於bash的`<<<'重定向操作符?
- 20. dplyr相當於DF [DF == X] < - Ÿ
- 21. ruby each_ <size_of_block>相當於each_byte
- 22. 在Swift中相當於id <type>?
- 23. VB6相當於列出<someclass>
- 24. 註解相當於<aop:scoped-proxy>
- 25. c#相當於java.util.concurrent.Future <T>
- 26. mvc 3相當於<asp:repeater>功能?
- 27. ToCharArray相當於列表<string>
- 28. @Configuration相當於<aop:config expose-proxy =「true」/>?
- 29. F#相當於Enumerable.OfType <'a>
- 30. Iphone相當於Android <include>和<merge>標籤?
我會說「不」,他們是兩個不同的編碼語言。 VBA你需要寫在你想要斜體範圍。 – Davesexcel