+ Reply to Thread
Results 1 to 3 of 3

no changes but VBA code stopped working

Hybrid View

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    Gilbert, Az
    MS-Off Ver
    MS 2010
    Posts
    23

    no changes but VBA code stopped working

    So I opened my project and this section of the code stopped working for some reason. the data still shows up but the date no longer auto populates - anyone have suggestions?
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim cel As Range
        If Not Intersect(Range("B53:B130"), Target) Is Nothing Then
            Application.EnableEvents = False
        For Each cel In Intersect(Range("B53:B130"), Target)
                If cel.Value = 0 Then
                   Target.Offset(0, 1).Value = ""
                Else
                   Target.Offset(0, 1).Value = Date
                End If
            Next cel
            Application.EnableEvents = True
        End If
    
    If Intersect(Range("H10"), Target) Is Nothing Then Exit Sub
    
    If InStr(1, Range("H10"), "Term'd / Left") = 0 Then Exit Sub
    
    MsgBox ("PLEASE EMAIL CPA, REVOKE AGENT BADGE ACCESS & ALL SYSTEM ACCESS. THIS TAB WILL NOW CLOSE.")
    
    Application.EnableEvents = False
        Range("H10") = "Term'd / Left"
    Application.EnableEvents = True
    
    If [H10] = "Term'd / Left" Then
     ActiveWorkbook.ActiveSheet.Visible = False
     Else
     ActiveWorkbook.ActiveSheet.Visible = True
     End If
        
    End Sub

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: no changes but VBA code stopped working

    Try putting this into a standard module and run it by itself. Then see if your code will fire after. Maybe somehow Application.EnableEvents got disabled

    Sub refresh()
     With Application
        .ScreenUpdating = True
        .EnableEvents = True
     End With
    End Sub
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    04-29-2016
    Location
    Gilbert, Az
    MS-Off Ver
    MS 2010
    Posts
    23

    Re: no changes but VBA code stopped working

    Mike thank you good sir. worked perfectly

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. My VBA code stopped working please help.
    By Dark0Prince in forum Excel General
    Replies: 5
    Last Post: 02-02-2017, 07:15 PM
  2. My VBA code stopped working please help.
    By Dark0Prince in forum Excel General
    Replies: 4
    Last Post: 01-10-2017, 06:46 PM
  3. [SOLVED] VBA Code is stopped working?
    By stoicy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-29-2016, 05:26 PM
  4. [SOLVED] Save code stopped working
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-02-2014, 07:18 AM
  5. [SOLVED] Why has my code stopped working?!
    By JamesFletcher in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2013, 07:07 AM
  6. Code stopped working
    By kinleyr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2010, 12:25 PM
  7. Code stopped working
    By chris46521 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2006, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1