Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Question
I populate an array from data in a text file. Then I go to a spreadsheet and
I look at a cell and want to find the text in that cell in the array. Is there an arrayfind() function to find the data that is in the cell? And can I sort the array so that the find is faster? Also, I populate a similar array with values. Can I have both types of data in one array, text and values? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Question
If the text file has the right layout then you could run SQL on that file.
This would save you the intermediary step of the array and is quite fast. Yes, you can sort arrays and then do a binary search, which could be a lot faster. Yes, you can have variant arrays that can hold both string data and numeric data. RBS "Mike H." wrote in message ... I populate an array from data in a text file. Then I go to a spreadsheet and I look at a cell and want to find the text in that cell in the array. Is there an arrayfind() function to find the data that is in the cell? And can I sort the array so that the find is faster? Also, I populate a similar array with values. Can I have both types of data in one array, text and values? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Question
Mike H. wrote:
I populate an array from data in a text file. Then I go to a spreadsheet and I look at a cell and want to find the text in that cell in the array. Is there an arrayfind() function to find the data that is in the cell? If your array is one-dimensional or a single"column", then e.g., =Application.Match(Range("A3").Value, yourArray) will return the "column" number in the array of the value that is in A3 (or the row number if the array is a single "column"). Alan Beban |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Question
The array can have any values you want, with wildly different ones you would
typically dim it as Variant. as far as finding, there are ways, but the system can probably loop through your array just as fast. do until myArray(myindex,1)=cells(1,1) myindex=myindex+1 loop -- -John Please rate when your question is answered to help us and others know what is helpful. "Mike H." wrote: I populate an array from data in a text file. Then I go to a spreadsheet and I look at a cell and want to find the text in that cell in the array. Is there an arrayfind() function to find the data that is in the cell? And can I sort the array so that the find is faster? Also, I populate a similar array with values. Can I have both types of data in one array, text and values? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array question | Excel Programming | |||
Array question | Excel Programming | |||
Another ARRAY Question... | Excel Programming | |||
array question | Excel Programming | |||
Is this an array question? | Excel Programming |