Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call engelle(Target.Column, 2, 5, Target.row) '2 demek B sütunu icin, 5 ise E sütunu
Call engelle(Target.Column, 7, 10, Target.row) '7 demek G sütunu icin, 10 ise J sütunu
End Sub
Sub engelle(hedefSutun As Byte, col1 As Byte, col2 As Byte, satir As Long)
Dim i As Byte
Static sayac As Byte
If sayac > 0 Then
sayac = 0: Exit Sub
End If
If (hedefSutun >= col1 And hedefSutun <= col2) And satir > 1 Then
For i = col1 To hedefSutun
If i = col2 - 1 Then GoTo var
If Cells(satir, i - 1).Value = "" Then
sayac = sayac + 1: Cells(satir, i - 1).Select
MsgBox "hata": Exit Sub
End If
var:
Next
End If
End Sub
C ve H sütunları hariç için alttaki kodu deneyin.If i = col2 - 1 Then GoTo var ve var: kodları eklendi dasece.