+ Reply to Thread
Results 1 to 2 of 2

Create dynamic variable range to use in function

  1. #1
    Registered User
    Join Date
    03-04-2017
    Location
    norway
    MS-Off Ver
    2016
    Posts
    41

    Create dynamic variable range to use in function

    Hello! I have a code to create matrix. This is last step to automatize as many stocks as I want in a covariance matrix(this is prior to actual matrix, but its same principle). I have a problem with some variables, because everything has to be dynamic. First I calculate how many cells that are used in the range. Then the code selects a range based on that value. This is no problem, but I need the formula to be dynamic. I need 2 variables at least; 1) is starting at A2 and select all used cells in the area(endToRight AND endDown). 2) is starting at A1003 and select used cells (endToRight). The formula should be first variable-second variable.
    Here is the code:

    Please Login or Register  to view this content.
    Everything in [B] code works fine and needs to be like that. It can change if it needs to be changed, but that part works fine.

    The error says; Can`t set formulaArray-properties in range class. Run time error 1004

    I appreciate any help!
    Last edited by olli.excel; 03-12-2017 at 08:19 AM.

  2. #2
    Registered User
    Join Date
    03-04-2017
    Location
    norway
    MS-Off Ver
    2016
    Posts
    41

    Re: Create dynamic variable range to use in function

    I solved the problem by doing it another way. Solution I use:

    Please Login or Register  to view this content.
    Rather did one cell, then fillDown, convert to relative reference and fillright. It worked properly, but have to use it twice, then use code to delete 0`s once:
    Please Login or Register  to view this content.

+ 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] create chart using dynamic range (Indirect Function)
    By umbata in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-08-2015, 10:37 PM
  2. Replies: 15
    Last Post: 09-10-2013, 05:31 AM
  3. [SOLVED] Create a variable with a dynamic name
    By Dralky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2013, 12:34 AM
  4. using offset function to create dynamic range based on a match search
    By freddiethomas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2013, 05:34 AM
  5. using offset function to create dynamic range based on a match search
    By freddiethomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2013, 04:14 AM
  6. Set a variable to a dynamic named range
    By BarryTSL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 06:18 AM
  7. Place a variable in the Range() for dynamic Range
    By qed59 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2010, 11:26 PM

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