Обнаружьте ключевое событие комбинации

Я не думаю, что это может быть сделано. Вот некоторый код, скопированный без модификаций с сайта Chip Pearson: http://www.cpearson.com/excel/UnSelect.aspx .

UnSelectActiveCell

Эта процедура удалит Активную ячейку из Выбора.

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

UnSelectCurrentArea

Эта процедура удалит область, содержащую Активную ячейку от Выбора.

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

7
задан Adarsh Ravi 12 June 2017 в 13:35
поделиться