更新时间:2023-02-12 19:37:02
您可以循环通过Selection对象来查看所选内容。以下是Microsoft的代码片段(http://msdn.microsoft.com/en-us/library/aa203726(office.11).aspx):
You can loop through the Selection object to see what was selected. Here is a code snippet from Microsoft (http://msdn.microsoft.com/en-us/library/aa203726(office.11).aspx):
Sub Count_Selection()
Dim cell As Object
Dim count As Integer
count = 0
For Each cell In Selection
count = count + 1
Next cell
MsgBox count & " item(s) selected"
End Sub