乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>excel</em> <em>vba</em> 设置中文、英文和

<em>excel</em> <em>vba</em> 设置中文、英文和

作者:乔山办公网日期:

返回目录:excel表格制作


如下图中,打开设置字体对话框,设置字体,然后点击左下角的【默认】按钮即可。




此题无解,条件格式无法改变字体、字号,本来以为下面的代码满足你的要求:

Sub Macro1()
    Range("A1:Y161").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
        Formula1:="=""(此项空白e68a84e8a2ade799bee5baa6e997aee7ad94365)"""
    With Selection.FormatConditions(1).Font
        .Name = "楷体"
        .Size = 8
    End With
End Sub

结果系统提示无法改变字体、字号。


如果数据不太多,可以自己监控数据变化,例如:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim C As Range
    For Each C In Target
        If C.Value = "(此项空白)" Then
            C.Font.Name = "楷体"
            C.Font.Size = 8
        End If
    Next C
End Sub




我录制出636f70797a64365来的有(选中图表中的标题,通过工具栏上的字号直接更改的)。
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.ChartTitle.Select
Selection.Characters.Text = "Test for LifeDebug"
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=18).Font
.Name = "宋体"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

    With Application
        .StandardFont = "等线 Light"
        .StandardFontSize = "10"
    End With

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网