Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
Trying to stop code running after delete rows.
Using boolean to stop code running. The code below I don`t want to run after delete
The code below I don`t want to run after the delete
Using boolean to stop code running. The code below I don`t want to run after delete
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
If Target.Column = 1 Then
On Error Resume Next
Set Rng = Application.InputBox( _
Prompt:="Select the range to Delete", _
Title:="Select Range", _
Type:=8)
Rng.EntireRow.Delete
For Each Cell In Rng
NoData = True And IsEmpty(Cell)
Next Cell
Exit Sub
End If
End Sub
The code below I don`t want to run after the delete
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name <> "Summary" And Sh.Name <> "Trend" And Sh.Name <> "Supplier BO" And Sh.Name <> "Dif Depot" _
And Sh.Name <> "BO Trend WO" And Sh.Name <> "BO Trend WO 2" And Sh.Name <> "Different Depot" Then
If Target.Column = 10 Then
If Sh.Range("AA1") = "" Then
ActiveSheet.Range("AA1") = 1
Call BO_Drop_DownList
Call BO_Reason
End If
End If
End If
If Target.Column = 1 Then
Call Group_OrderNos
End If
End Sub
Last edited by a moderator: