Regression Macro Stops Unexpectedly

EnergyModeler

New Member
Joined
Aug 16, 2019
Messages
7
Hello,

I created a macro to run a linear regression automatically, and when I execute the code it works properly. However, when a coworker tries, it is as if the macro stops unexpectedly with no error or anything. It just doesn't continue on. This is a snippet of the code. It completes the Application.Run but stops at the Range.Select that follows. Any help would be appreciated!

Code:
Dim x1 As Long, y1 As Long
    x1 = Range("M" & Rows.Count).End(xlUp).Row
    y1 = Range("O" & Rows.Count).End(xlUp).Row


    Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("M5:M" & x1), _
        ActiveSheet.Range("O5:S" & y1), False, False, , "", False, False, _
        False, False, , False
    
    Range("B17:B22").Select
    Selection.Copy
    Sheets("Data").Select
    Range("U4").Select
    ActiveSheet.Paste
    ActiveWindow.SmallScroll Down:=-12
    Application.CutCopyMode = False
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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