+ Reply to Thread
Results 1 to 3 of 3

Arrays in VBA errors

  1. #1
    Registered User
    Join Date
    06-07-2020
    Location
    Russia
    MS-Off Ver
    2016
    Posts
    1

    Arrays in VBA errors

    Colleagues, I wrote a function in VBA to calculate the values of a two-dimensional array.
    The principle of operation (I want to) is as follows:
    1. The values entered were read and written in a single array;
    2. Based on the elements of this array, the values of the two-dimensional array were calculated. In this case, the formula for the first column of the two-dimensional column and the rest column is different.
    3. The output of the results on the tab.

    Alas, the function does not work without any error detailing.

    Please tell me where you can look to find the error.

    Thanks for your support"
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Arrays in VBA errors

    Welcome to the forum,

    Function vba code is not a reflection of the worksheet function in the worksheet "1" in column "U".
    should the vba function work like an Excel formula in the "U" column ?
    If not, what should the vba function code do ?
    Use "Variant" instead of "Currency".
    "input0" is a two-dimensional array, and you declared the "inp1" variable as a one-dimensional array.
    How did you want to assign such different variables ?
    The variables 'k', 'c', 'i' declared in such a way - 'Dim k, c, i, j As Integer' - are not of the 'Integer' type but 'Variant'.
    Active "Select" command in the vba function ? So, this is not a function.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Arrays in VBA errors

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will provide the link for you this time: https://www.planetaexcel.ru/forum/in...ernogo-massiva)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Querying Large Series of Arrays And Displaying Unique Values in Arrays [Hard Index Match?]
    By larryg003 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-28-2020, 04:52 PM
  2. [SOLVED] arrays, OLE action errors, IndexMatch and Calendars
    By phpolicylady in forum Excel General
    Replies: 9
    Last Post: 04-16-2019, 03:28 PM
  3. storing multiple value in a single cell (through arrays or without arrays)?
    By mak51061 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-25-2014, 09:27 PM
  4. Declaring multiple multi-dimensional arrays (jagged arrays) - compile error?
    By dfribush in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2013, 05:06 PM
  5. [SOLVED] New to arrays-where do I find a good beginners guide to multi dimensional arrays
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-04-2013, 07:44 PM
  6. Determining Arrays and Errors
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2010, 04:27 AM
  7. [SOLVED] Arrays - declaration, adding values to arrays and calculation
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2006, 11:15 AM

Tags for this Thread

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