arrays

  1. H

    Comparing Arrays

    Hi, I have two arrays that contain a date, amount and description. I need to compare the two arrays and then process the differences. Possibly place the contents in another array so they can be processed or output them into a sheet. Thanks
  2. Z

    arrays verses worksheet for math

    I have a workbook which currently uses a worksheet to do a lot of math for a user form. Speed, accuracy and overall performance is very stable so far. My question is, I've always wanted to do the math in memory with arrays just because I guess and learn arrays. So short of that is there a more...
  3. Z

    arrays count unique items?

    Hello folks, I have an array of say (s,e,se,sw,s,n,ne,ne,s,e,se) and would like the count of the unique items in that array using VBA. 7 in this example I believe. Is this possible and how would it be done?
  4. A

    Pivot Table Challenge - Arrays?

    Excel friends, The Pivot Below has more than 10,000 Codes. I need to find a formula or a way to get a list that looks like the summary on top. The Description is the one corresponding to the maximum on the Total Column. I understand it can be done with Arrays. It will be a very elegant...
  5. A

    Sorting an Array "Subscript out of Range"

    Can anyone help me with what I am not understanding regarding this bubble sort. This is just the start of my learning curve and I'm falling at the first hurdle. This is a one dimensional array with 762 rows in a single column. Am I getting mixed up with the operation of rows and columns here...
  6. G

    Using Arrays to populated Matrices and other data

    I have a spreadsheet where i create 4-5 fairly large matrices in worksheet cells and then perform some further calculation using these. I'd like to update the spreadsheet to not use worksheet cells and to hopefully run faster. I've started to do this using 2D Arrays to store my data in...
  7. C

    Which one cost more memory to run?

    Dear forum users, I'm sure there's answer to this on Google but I can't seem to find it. I'm used to storing data in VBA arrays and/or collections. But that can sometimes be hard to visualise when I have so many of them. The other way is just to store it on the worksheet! It is easier to...
  8. L

    Using a variable inside code

    Hello guys, I'm trying to minimize lines that i have in my code and i ran into a small problem I'm not sure how to approach I have 3 arrays that i fill up depending on a variable: If fullArray(i, 2) >= 1 And fullArray(i, 2) < 3 Then arrayInQuestion = "sheet2" If fullArray(i, 2) >= 3 And...
  9. M

    VBA Arrays

    Hello, I am using VBA arrays to select certain options in the list. For Example the Code below Selects five people in the table. What I want to do with the array is to select everything excluding the options already selected. So instead of selecting these five people, select everything else in...
  10. L

    Keeping array values after macro run

    Hey guys, I have a project that I'm making and it contains 3 arrays. Once i run the macro, all the actions are done, but the array is not erased, if i re-run the macro the values inside keep doubling(keeps old values and adds them again). I am using erase at the end of the last sub now to make...
  11. Z

    Subscript out of Range every time?

    I keep getting a "subscript out of range" error on the If statement. I've tried changing the start index to 0 and 1 and it still had this error. Sorry the codes messy, part of the reason I've been messing around with a lot of different ways to declare the array. I'm trying to alter values of...
  12. J

    Erasing Arrays after use question

    Hi, I have a macro that uses multiple arrays and after use I have a reset button which clears these: erase MyArray1 etc... However in some cases not all arrays are initiated so when I attempt to erase those I get an error as they don't exist. Is there a way, when erasing them to check if they...
  13. 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...
  14. E

    How to import CSV data into multiple arrays and to return the multiple arrays via a function or sub in VBA?

    I want to create a VBA add-in that imports a CSV file, split the data columns into separate arrays and returns these multiple arrays to the sub that calls this add-in. Not sure what is the best way to go about this. For example, my data folder contains many CSV files where each has 5 columns of...
  15. N

    ARRAY number of rows and colums, how to know the correct values for the size...

    This is the first time I'm trying to use ARRAY's in Excel. Reference: =IF(ROWS(A$10:A10)>$D$8,"",INDEX(Gas!A$6:A$18,SMALL(IF((Gas!$A$6:$A$18>=$C$4)*(Gas!$A$6:$A$18<=$E$4),ROW(Gas!A$6:A$18)-ROW(Gas!$A$6)+1),ROWS(A$10:A10)))) For example, it seems that the reference table A6:A18 in this case...
  16. S

    out of memory with small array

    All, I've ran into an error with my code where it gives me an out of memory error after i try to paste an array to a range. I've read through a lot of posts and everything seems to be with arrays in very large sizes which mine only has 13,000 rows. The strangest part is i have some string...
  17. H

    Have the value in a cell cause the same value in an array of data to light up red when value is equal

    Hard to explain what I'm looking for or if it is even possible. B5 is the cell in which I have any value #.# (ex. 17.2) I have an array of data from J5 to AB5 which different values Another array from J10 to AB10 with different values and so forth Currently these arrays are not one on top of...
  18. 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...
  19. L

    union range into array

    Hey guys, I'm trying to dodge making cycles to fill up my array, so i was hoping to just do this: lastRow = Cells.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row Set bigRange = Application.Union(Range(Cells(2, 3), Cells(lastRow, 3)), Range(Cells(2, 4), Cells(lastRow...
  20. B

    New to arrays - Array not returning values

    Hello all, I am trying to use arrays for the first time and I am flummoxed! Although the array seems to be populating when I write the values to it, any attempt to read those values fail as nothing is returned. Now I KNOW that this is my stupidity and I have checked and rechecked the code that...

Some videos you may like

This Week's Hot Topics

Top