Code stops, VBA editor opens automatically...

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have some code running on my computer that is operating fine, but on another guy's computer, it gets hung up. on the Worksheet Change, I have this code (partial):
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False
[COLOR=#000000]Application.EnableEvents = False[/COLOR]

If Range("D2") = "Free Flap / small Flap" Then
    With ActiveSheet
        lRow = .Cells(.Rows.Count, "F").End(xlUp).Row
    End With
    Range("F2:F" & lRow).ClearContents
    Application.Range("fFlap").Copy _
    Destination:=Worksheets("Mainpage").Range("F2")
    With ActiveSheet
        lRow = .Cells(.Rows.Count, "F").End(xlUp).Row
    End With
    Range("F2:F" & lRow).Select
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    Columns("F").AutoFit
    Range("F2").Select
End If

...etc
As stated above, it runs fine on my computer. However, on another computer when cell D2 is changed, the VBA editor opens automatically with the code stopped on the Application.EnableEvents line (highlighted yellow in the editor). He has to hit the run button to get it to complete.

...any ideas?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I think this is a bug in VB Environment. I get VBE stops (where none exist) on lines of code in Microsoft Access too. That person must press F5 to continue.
VB thinks there is a stop point. THERE'S NOT!

I sometimes correct it in Access by compacting the database, but have no idea how this can be done in Excel.
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

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