Hello,
I would like to have a nested if or select case statement to handle a worksheet event.
The conditions it will check are:
1. Make sure target is w/in range, otherwise EXIT
2. Make sure that target offset value is not empty, otherwise display message
3. All is good, open form
I’ve tried various formulations and positionings of the statements ,but not all conditions are met with equal success.
What happens is I get the the first two conditions, but the third doesn’t work.
![]()
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim Rng1 As Range Set Rng1 = Range("DBlClick") If Intersect(Target, Rng1) Is Nothing Then Exit Sub Cancel = True 'If Intersect(Target.Cells.Offset(0, -6), Rng1) Is Nothing Then ' MsgBox "You must first fill in the necessary data " ‘Exit Sub frm_EditPricing.Show End Sub
I’ve attached a workbook for clarification
Thanks
Mark
Bookmarks