Greetings Overflow Team,
Have a range (merged cell) M5:O5 that needs to trigger a MSGBOX as follows:
- If range is edited and is NOT NULL, THEN MSGBOX appears (not if selection changes)
- If range is DELETED to a NULL value THEN NO MsgBox
- If range is selected and box is empty or has data THEN NO MsgBox
Please don’t laugh at this code (well, yes, if you look at this and it makes you laugh, then go ahead). Here is what I have so far:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim billtoanswer As Integer
'If IsNull(Range("M5:O5")) Then <-- other stuff I was trying
'End
If (Application.Intersect(Range("M5:O5"), Target) Is Nothing) Then
End If
billtoanswer = MsgBox("Use this address for Bill To?", vbYesNo + vbQuestion, "Bill To?")
If billtoanswer = vbYes Then
Range("F26").Value = Range("M4").Value & ", " & Range("M5").Value
End If
End If
End Sub
In advance, I thank you all for the assistance.
Microsoft® Excel® for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit