Hi, I have a WorkSheet with several UserForms that are opened by double clicking on a cell, using
Please could you explain why the above code is better than:
To me Select Case seems a lot less code and easier to understand than the double negative of "Not Application.Intersect" suggested in most examples.
Thanks for setting me straight
David
Code:
If Not Application.Intersect(Target, Range("S2:S" & lRow)) Is Nothing Then
Cancel = True
UserForm7.Show
Exit Sub
End If
If Not Application.Intersect(Target, Range("T2:T" & lRow)) Is Nothing Then
Cancel = True
UserForm8.Show
Exit Sub
End If
Please could you explain why the above code is better than:
Code:
Cancel = True
Select Case ActiveCell.Column
Case "1"
insertRowBelow
Case "8"
UserForm3.Show
Case "9"
UserForm1.Show
Case "10"
UserForm5.Show
Case "13"
UserForm4.Show vbModeless
Case "16"
UserForm6.Show
Case "19"
UserForm7.Show
Case "20"
UserForm8.Show
End Select
To me Select Case seems a lot less code and easier to understand than the double negative of "Not Application.Intersect" suggested in most examples.
Thanks for setting me straight
David