VBA/Excel/Access/Word/Excel/Selection Format — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:33, 26 мая 2010
Increases font size of the selected cells
Sub IncreaseFontSize_Standard()
Dim rng As Range, ar As Range
If Selection Is Nothing Then Exit Sub
For Each ar In Selection.Areas
For Each rng In ar
rng.Font.Size = rng.Font.Size + 2
Next rng
Next ar
End Sub
Toggles between normal, bold, italic and bold+italic
Sub ItalicBold()
Dim bld As Variant, ital As Variant
If Selection Is Nothing Then Exit Sub
bld = Selection.Font.Bold: ital = Selection.Font.Italic
If Not bld And Not ital Then
bld = True
ElseIf bld And Not ital Then
ital = True: bld = False
ElseIf Not bld And ital Then
bld = True
Else
bld = False: ital = False
End If
Selection.Font.Bold = bld: Selection.Font.Italic = ital
End Sub