|
'活动单元格:activecell,工作表中活动单元格只有一个
Sub activecells()
a = activecell.Address '取得活动单元格地址
Cells(2, 3).Activate '激活指定单元格
End Sub
'selection光标所选区域
Sub 光标所选区域()
Selection = 1
End Sub
Sub 在selection中的改变活单元格()
For i = 1 To Selection.Count
Selection(i).Activate
Next
End Sub
Sub 运用()
Dim i As Range
For Each i In Selection
If i = "" Or i = "缺勤" Then
i = "×"
End If
Next i
End Sub
'小结:selection的好处在于,可以很自由灵活选择你想要处理的单元格区域
|
|