Hello everyone,

I'm trying to figure out how to pass a range variable that I request from a user in a message box into the fourier range selection but can't seem to figure it out. Here is a working version of that VBA code with the range selected manually within the application itself (the code was generated by recording a macro while doing it).

Sub Macro3()

        Application.Run "ATPVBAEN.XLAM!Fourier", ActiveSheet.Range("$A$2:$A$5"), _
        ActiveSheet.Range("$H$1:$H$4"), False, False
        
End Sub
So this obviously works, however, when I remove the manually inserted range and replace it with a variable I assigned to a range in the sheet it either says syntax error or expected function. Here is one of about a half dozen attempts at using the right syntax to assign a variable range.

Sub FourierSinGen()


Application.Run "ATPVBAEN.XLAM!Fourier", Worksheets("Macro_Sheet").Range("rngCatCells"),
     Worksheets("Macro_Sheet).Range("rngOutCells"), False, False
The variables rngCatCells and rngOutCells have each been assigned a range value defined by the user. How should this syntax look so excel recognizes these variables as the cells to perform the fourier transform on and the cells to place the produced values into?

Thank you for any help you can provide