Excel VBA入门与宏操作指南
1. 宏代码基础
宏代码通常位于 Sub 和 End Sub 关键字之间。以下是一段示例代码:
Range("A2").Select
Selection.Style = "Neutral"
Range("B2").Select
ActiveCell.FormulaR1C1 = "Numbers"
Range("A3").Select
Selection.Style = "Calculation"
Range("B3").Select
ActiveCell.FormulaR1C1 = "Formulas"
Range("B1:B3").Select
With Selection.Font
.Name = "Arial Narrow"
.FontStyle = "Italic"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
End Sub
Sub RemoveFormats()
'
' RemoveFormats Macro
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



