|
Sub Macro10()
'
' Macro10 Macro
'
' 快捷键: Ctrl+Shift+D
'
Range("B1").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B2").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B3").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B4").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B5").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B6").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Superscript = True
End With
Range("B7").Select
End Sub
**************************************************************
以上是将B1——B7的单元格内最后一位数字变成上标的宏,请问如何简化成for语句,谢谢 |
|