2025年2月25日 星期二

VBA:ChartObjects X軸 文字設定(ActiveChart.Axes(xlCategory))

設置圖表1的X軸標籤的文字大小

ActiveSheet.ChartObjects("圖表 1").Activate

 With ActiveChart.Axes(xlCategory).TickLabels.Font

    .Size = 12 ' 設置字體大小為 12

End With

修改標籤的標題文字大小、字體、顏色

With ActiveChart.ChartTitle.Font

    .Name = "Arial" ' 字體名稱

    .FontStyle = "Bold" ' 字體樣式

    .Size = 14 ' 字體大小

    .Color = RGB(255, 0, 0) ' 字體顏色

End With

其他常見的修改與方式:

'修改字體種類

ActiveChart.Axes(xlCategory).TickLabels.Font.Name = "Arial"

'粗體

ActiveChart.Axes(xlCategory).TickLabels.Font.Bold = True

'斜體

ActiveChart.Axes(xlCategory).TickLabels.Font.Italic = True

'底線

ActiveChart.Axes(xlCategory).TickLabels.Font.Underline = xlUnderlineStyleSingle


沒有留言:

張貼留言

12 星座未來一週股市走跳|2026/8/23–8/29(台股×美股)

12 星座未來一週股市走跳|2026/8/23–8/29(台股×美股) 本報以 印度占星月亮星座 Rashi 為準(恆星黃道 Sidereal,2026 歲差約 24°13'),星曆由純 Python 天文演算法(VSOP87+章動+Lahiri 歲差)真...