Question : Excel vba - how to determine if 3 cells are empty?

I'm coding in Worksheet_BeforeDoubleClick() and using Marlett font's letter "r" to show an X if a cell is double-clicked, but clear the X if double-clicked again.

For 3 particular cells (E46:E48) within this double-click range, if an X (Marlett "r") exists and a double-click will remove it (target = vbNullString), I need to check to see if any of the 3 cells (E46:E48) still contain an X (Marlett "r"), and if they are all blank, I need to do something to a different cell.

I can't get my code to work: it's line 8 in the code below that's not working right.
Hope someone can help.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
If Target.Cells.Count > 1 then Exit Sub
If Not Intersect(Target, Range(“E18:E328”)) Is Nothing Then
	Target.Font.Name = “Marlett”
	If Target = vbNullString Then
		Target = “r”
	Else
		Target = vbNullStrung
		If Not Intersect(Target, Range(“E46:E48”)) Is Nothing Then
			If IsNull(Range(“E46:E48”)) Then
				…do something to a different cell
			Else
				…blah, blah
			End If
	End If
End If

Answer : Excel vba - how to determine if 3 cells are empty?

I had the Cancel = True statement in a less than optimal place. If you move it before the last End If, that would permit the normal double-click event to occur if the user double-clicks outside the range E18:E328
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E18:E328")) Is Nothing Then
    Target.Font.Name = "Marlett"
    If Target = vbNullString Then
        Target = "r"
    Else
        Target = vbNullString
        If Not Intersect(Target, Range("E46:E48")) Is Nothing Then
            If Application.CountA(Range("E46:E48")) = 0 Then
                Range("F46") = "True"
            Else
                Range("F46") = "False"
            End If
        End If
    End If
    Cancel = True
End If
End Sub
Random Solutions  
 
programming4us programming4us