My code has been firing up when I change a value in col 1

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
424
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Why will this code not fire up when I change a cell in col 1 or col 10 it always used to?

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim wb     As Workbook
    Dim ws     As Worksheet
    Dim xRg    As Range, KeyCells As Range
    Dim Rng    As Variant
    Dim LRow   As Long, LRow2 As Long
    Dim WsConfig As Worksheet
    Dim lngStartRow As Long, NumRows As Long
    Dim Found  As Boolean
    Dim i      As Integer
    Dim x      As String

    With Application
        .ScreenUpdating = False
        .Calculation = xlCalculationManual
    End With
    
    Set wb = Workbooks("2023BackOrderReport.xlsm")
    Set ws = wb.Worksheets("Data")
    Set WsConfig = wb.Worksheets("Config")
    LRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
    
    Call DeleteTbl
    
    If Target.Column = 1 Then
    
    Call DropDownListCode
    
    Call CopyData
    
    Call CreateTbl
    
    End If
    
    If Target.Column = 10 Then
    
    Call EmailDepots
    
    End If
    
    With Application
        .ScreenUpdating = True
        .Calculation = xlCalculationAutomatic
    End With
    
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Do you have any code that could have disabled events?

Try running the below sub and see if it works after:
VBA Code:
Sub EnableEvnts()
    Application.EnableEvents = True
End Sub
 
Upvote 0
Does the code in 'DeleteTbl' contain the lines:
VBA Code:
EnableEvents = False

or

On Error Resume Next
?

I am thinking that maybe 'DeleteTbl' is encountering an error and leaving EnableEvents set as false
 
Upvote 0
Have you restarted Excel?
 
Upvote 0
Is the code being triggered at all? Have there been any office updates applied in between it working and it stopping?
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,974
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top