About 50 results
Open links in new tab
  1. How to pass an array to a function in VBA? - Stack Overflow

    Apr 17, 2017 · 54 This seems unnecessary since the Array() function documentation clearly states that the function returns a Variant type, but VBA is a strange place. If you declare an array variable (of …

  2. VBA Passing an array to a function and back - Stack Overflow

    Here is why: The code that calls the function already knows that it wants to use Title and Checked, so nothing is lost when it gets an array of ContentControl instances instead of a multi-dimensional array …

  3. Return array from function in VBA - Stack Overflow

    I would like to write a function to return an array of integers so I can index them, but I am not aware of the syntax for VBA. Here is the pseudo code: function getStats() as integer dim return...

  4. excel - Creating an Array from a Range in VBA - Stack Overflow

    Jun 8, 2016 · This function returns an array regardless of the size of the range. Ranges will return an array unless the range is only 1 cell and then it returns a single value instead.

  5. Array function in Excel VBA - Stack Overflow

    Apr 24, 2012 · 8 I have a function in VBA that generates an array of strings. It works fine when called from another VBA function, but not when called from the worksheet. Here's how it should be used: …

  6. Passing an Array or Range through a function in VBA

    May 5, 2017 · 2 So I want to make a basic function that takes an average of values that I highlight in Excel. I am well aware there is already a built-in function in Excel for this but I am trying to make one …

  7. Is there a way to create a 2-dimensional array in VBA using Array …

    Apr 9, 2021 · A) Quick alternative via Excel/MS 365 To quickly create a 2-dim array (with well defined steps) you could profit from the new SEQUENCE() function in Excel for MS 365:

  8. excel - Correct way to return an array from VBA function - Stack Overflow

    Mar 3, 2020 · My school uses Excel 2016 (pre-{=array} era) and so I am using VBA to define some missing function that I need. One function that I tried implementing in VBA is a SEQUENCE …

  9. sorting - VBA array sort function? - Stack Overflow

    I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other sort algorithm other than bubble or merge would suffice. Please note that this is to work

  10. Check if a value is in an array or not with Excel VBA

    I did a test with an array of size 2000. The worst case scenario for looping through the array would be looking for the last item (at index 2000). After 5000 calls to both the function and looping, the total …