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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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