|
"左隣のB列の値が、収か発かで処理を分岐する"というロジックの方が、確実では
ないでしょーか ? それならこんな感じです。
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
Dim CkR As Range
On Error Resume Next
If Intersect(Target, Range("B:B").SpecialCells(2).Offset(, 1)) _
Is Nothing Then Exit Sub
If Err.Number <> 0 Then Exit Sub: On Error GoTo 0
Cancel = True
With Target
Select Case .Offset(, -1).Value
Case "収": Set CkR = .Offset(1)
Case "発": Set CkR = .Offset(-1)
Case Else: Exit Sub
End Select
If IsEmpty(.Value) Then
.Value = "●"
If CkR.Value = "●" Then
CkR.ClearContents
End If
Else
.ClearContents
End If
End With
Set CkR = Nothing
End Sub
|
|