当选择了一个excel行并按住它并单击它时,该行不会被取消选中。 有没有办法使用键盘取消选择特定行?
答案 0 :(得分:3)
抱歉,这是不可能的。
我所能做的就是引导你到Chip Pearson的网站,该网站有可以取消选择细胞/区域的宏
此处提供的代码:
此过程将从选择中删除活动单元格。
Sub UnSelectActiveCell()
Dim R As Range
Dim RR As Range
For Each R In Selection.Cells
If StrComp(R.Address, ActiveCell.Address, vbBinaryCompare) <> 0 Then
If RR Is Nothing Then
Set RR = R
Else
Set RR = Application.Union(RR, R)
End If
End If
Next R
If Not RR Is Nothing Then
RR.Select
End If
End Sub
此过程将从选择中删除包含活动单元格的区域。
Sub UnSelectCurrentArea()
Dim Area As Range
Dim RR As Range
For Each Area In Selection.Areas
If Application.Intersect(Area, ActiveCell) Is Nothing Then
If RR Is Nothing Then
Set RR = Area
Else
Set RR = Application.Union(RR, Area)
End If
End If
Next Area
If Not RR Is Nothing Then
RR.Select
End If
End Sub