Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 424
- Office Version
- 365
- Platform
- Windows
- Mobile
Also I would like to end sub when user presses Cancel how is this possible when it`s a range of cells in inputbox
VBA Code:
Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim Rng As Range
Dim NoData As Boolean
Dim Cell As Range
Dim Text As Variant
Set Rng = Application.InputBox( _
Prompt:="Select the range to Delete", _
Title:="Select Range", _
Type:=8)
Application.EnableEvents = False
Rng.EntireRow.Delete
Exit Sub
Application.EnableEvents = True
End Sub