Verilen Alan Seçilemesin - Microsoft Excel


İlgili alan seçilmeye çalışıldığında bu seçimi engelleyen VBA kodudur.

Kod


Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Dim alan As Range
    
    Set alan = Range("A1:B100")
    
    If Not Application.Intersect(Target, alan) Is Nothing Then
        Cells(ActiveCell.Row, 3).Select
        MsgBox alan.Address & " aralığı seçilemez!"
    End If
End Sub

Etiketler
microsoft excel microsoft excel vba microsoft excel vba alan işlemleri