I am running a vba macro in excel reading through the list of data (3000) large and checking dates, if the current dat is the same as the previous date it needs to store the corresponding value, and so on until the date changes, then average the stored values and output it on the first one, and 0 the rest
Sadly this takes well over 20 mins to run, so I can across This website that shows a way of bulk reading data into vba, cutting down on hit times. When I ran just a quick test seemed to cut down the time dramatically, the problem I am having is in his code
Sadly this takes well over 20 mins to run, so I can across This website that shows a way of bulk reading data into vba, cutting down on hit times. When I ran just a quick test seemed to cut down the time dramatically, the problem I am having is in his code
I have no idea how to get the data out of A, when I try to treat it like a array it gives me the subscript out of range error, and if I assign it as an array before hand it crashes with another error, just wondering if anyone knows how to extract the data from A, if not, does anyone know another good way to bulk read data into vba?'to read in
Dim A as Variant 'MUST be variant, no brackets
A = Range("SomeRange").Resize(10,20) 'reads 10x20 array starting at range SomeRange
'(NB I've used Resize above but you can specify a range of cells any way you want)
'to write back to sheet
Range("SomeRange").Resize(10,20) = A
'A can be any data type but MUST be two dimensional even if you are only writing one
'column or row - first dimension is used for rows, and the second for columns
'this can be slow - see third question below for workaround..