redim

  1. NicholasP

    Email sending with subject line in Chinese Characters

    I have some code that works fine on my machine, but when my coworker runs it, the subject line comes through as Chinese characters. The email still sends with the file attached, but the subject line has the Chinese characters. Has anyone seen this before or have any ideas as to why this is...
  2. S

    Maximum Size for a 2 dimensional array

    Hi - Been a while, but I'm hoping to find a way to fix a limitation on a reconciliation tool I designed a while back to compare two extracts from an SQL database. In particular I'm having trouble on memory limitations when Resizing a Variant array: ReDim Ukey(1 To MyDict.Count, 1 To ((H - 1)...
  3. S

    Minimum Value

    Dear all I am trying to find the minimum value in the array Stress(i,j) The maximum value appears correct. However the minimum value always appears zero if all the elements are positive. Kindly help I am posting the code below Private Sub CommandButton1_Click() Dim i As Integer Dim...
  4. L

    Clearing empties from a 2d array

    Hey guys, i have an array, once creating it i make it 2d: ReDim allPksWithEmpty(1 To lastRow, 1 To 2) Since I'm not able to set the 1st dimension anymore, i cap it out at maximum rows in sheet. Of course i only pick up a little data depending on some ifs, thus i end up with a big array...
  5. K

    Limit numbers for X and 2

    Using Excel 2000</SPAN></SPAN> Hi,</SPAN></SPAN> The code below generate any combinations I use for example Const v& = 4 to 14 where Array is ("1", "X", "2") (3^4=81, and 3^14=4.782.969) so in the given example 3^4= 81 combinations are generated in the column A and column C & D there is a...
  6. L

    extending array per every input

    Hey guys, im trying to fill up my array and extended whenever needed: arraySizeX = 1 arraySizeY = 2 ReDim Preserve orderArray(1 To arraySizeX, 1 To arraySizeY) orderArray(1, 1) = "test" orderArray(1, 2) = lastRow - 1 arraySizeX = arraySizeX + 1 ReDim Preserve orderArray(1 To arraySizeX, 1 To...
  7. 2

    ReDim Preserve Query

    Hi, I have the following vba code, which populates an array with the contents of the first 5 rows of column A. Sub populate_array() Dim parameters_2DArray as Variant parameter_2DArray = Worksheets("Sheet1").Range("A1:A5").Value [rest of code] End Sub I'm assuming the parameter_2DArray...
  8. J

    Error in passing data from a Function to a Subroutine

    I have a function from which I am passing data to a subroutine and then populating the output. When I am using x, y as is, I am getting the output, but when I use arr1, arr2 instead I do not get an output. The code is: Option Explicit Option Base 1 Public Function Func1(ByVal x As Range, ByVal...
  9. T

    How do I insert non-adjacent columns into an array?

    Hello all you MrExcel experts I have a sheet with 26 columns and approximately 250,000 rows of data. The number of columns will stay the same, however, the number of rows will increase. I will be comparing data in columns 'B, D, N, Q', and depending of the results of that comparison, some...
  10. J

    How do I find the number of dimensions of an array in VBA?

    So if I have dim varArray1() as Variant dim varArray2() as Variant redim varArray1(1,1,1,1) redim varArray2(10,10,10) How do I get something like GetDimensions(varArray1)=4 GetDimensions(varArray2)=3
  11. D

    Help populating multiple arrays with one for loop

    I apologize if this has been answered elsewhere...I searched for quite a while and found nothing specific for what I am hoping to do. I am trying to populate multiple 1D arrays with a nested For Next loop. I have tried to use a string to build the array name (ie. arr1, arr2, etc.) and...
  12. A

    Verify Value Of All Controls Added Dynamically Upon Exit Using With Events Method

    Hello All, I have created a blank user form. Dynamically I have added Text Box, Label, Check Box and command Button to it. I have been able to handle the even generated while command button is clicked.Upon clicking the command button, user form will be unloaded. However I am trying to validate...
  13. S

    Cannot assign value of calculated range cell to a variable

    This is driving me bonkers. I don't think I've ever had this issue before but... I have a function that takes several ranges from a spreadsheet and calculates a spline curve from them. The mechanics aren't important. Because this thing is having trouble in a REALLY WEIRD WAY. The function is...
  14. K

    Row and Column Count for a lookup array

    Can someone show me the best way to do a Row and Column count for this lookup array? [ ReDim aTrades(1 To 4, 1 To 2) As Variant ReDim aSystemCodes(1 To 69, 1 To 2) 'todo: do a row and column count of the above lookup arrays and use variables /]
  15. S

    User Defined Function Error "subscript out of range"

    I am writing a UDF to return array variants given the UDF subscript values. The UDF is below: Function LogPriceData(Arr As Variant, numberObs As Integer) As Variant Dim yy As Integer Dim Array1() As Variant: ReDim Array1(1 To numberObs) Dim Array2() As Variant: ReDim Array2(1 To...
  16. M

    what's wrong with this code

    it keeps ignoring the last condition... If zz Like Left(Replace(activ_code, 0, "?"), Len(Replace(activ_code, 0, "?")) - 1) & "1" _ And Left(zz, Len(zz) - 1) <> Left(activ_code, Len(activ_code) - 1) _ And...
  17. M

    What does this vba mean????

    What does Dim DC() mean? I'm used to only seeing "Dim as" whatever. What does this code do? Dim DC() ReDim DC(LCol - 6) For i = 0 To LCol - 6 DC(i) = i + 6 Next
  18. L

    Urgent help needed - "Runtime error 9: subscript out of range"

    Hi all, I am currently finishing my master thesis including simulations and have run into an issue. I am running simulations through a "Monte Carlo" macro that was imported from another work book. After each run I receive the error message "Runtime error 9: subscript out of range". When I...
  19. M

    VBA Copy data from Array to another help

    Hi all, I am learning more about Arrays but I got to this point & I am stuck & need some help here. So in "Sheet1" I have a list of data that spreads for about 17k rows & over 9 columns & in "Sheet2" I have list of values that I type in column A which then I am looping against my data from...
  20. M

    VBA FILTER function: SourceArray argument causing Type Mismatch error?

    Hi guys, I have a piece of code which requires using the FILTER Function, however the SourceArray argument is giving me a Type mismatch error, any help would be greatly appreciated. This doesn't work Dim bDistinct as Boolean Dim arrList2() Variant Redim arrList2(1 to 1559, 1) arrList2 =...

Some videos you may like

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top