+ Reply to Thread
Results 1 to 3 of 3

Passing a variable range into fourier transform

  1. #1
    Registered User
    Join Date
    11-13-2015
    Location
    Norfolk, VA
    MS-Off Ver
    2013
    Posts
    1

    Passing a variable range into fourier transform

    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).

    Please Login or Register  to view this content.
    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.

    Please Login or Register  to view this content.
    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

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Passing a variable range into fourier transform

    "rngCatCells" (in quotes) tells VBA to look for a named range with the name rngCatCells. It does not sound like you have defined such a name in that sheet.

    rngCatCells (without quotes) tells VBA to use the range object stored in the range variable (assuming the variable is properly dimensioned and assigned) rngCatCells. This sounds like what you are trying to do.

    Based on my understanding, I would suggest removing the quotation marks from around rngCatCells and rngOutCells.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Passing a variable range into fourier transform

    Welcome to the forum!

    If you can attach a simple example file with some test data, it would be easier to help. Include the one with the named ranges added or how you are setting those.

    To attach a file, click the Go Advanced button in bottom right of a replay, click the paperclip icon in the toolbar, and then browse and select the file to Upload.

+ 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. [SOLVED] passing a range name as a variable results in error 1004
    By darahsten in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 03:28 AM
  2. [SOLVED] Passing a variable range to a formula
    By jacob@thepenpoint in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2012, 06:44 PM
  3. [SOLVED] VBA code for passing a variable name as a paramter to Range object
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-09-2012, 04:37 PM
  4. Creating chart by passing sourcedata as variable range
    By lavi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2010, 09:18 AM
  5. "Reference is not Valid" when calling fast fourier transform
    By JacksonRJones in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2006, 09:10 AM
  6. [SOLVED] referring to worksheets by name in a vba fourier transform
    By JacksonRJones in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2006, 03:40 PM
  7. Fast Fourier Transform routine in Tools add-in menu
    By Tutorguy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2006, 12:55 PM
  8. [SOLVED] Fast Fourier Transform
    By Ad Pronk in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-12-2005, 07:06 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