Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ciao, Rick,
thanks for the links, I've checked them out and it looks like I'd better give up using arrays in favour of dictionaries. I wonder if there could be some overhead in using dictionaries instead than arrays coupled with a FindElementInArray function: I have no idea because I've never heard of dictionaries until now. What do you think? Would it make sense to always use a dictionary when I need a resizable data structure which must be often searched for a particular element? I'm surprised I've never heard of similar structures in other (admittedly older) languages. Is this maybe characteristic of Object Oriented Programming? Or it's just me being ignorant? :) Best Regards Sergio Rossi On 12 Feb, 19:04, "Rick Rothstein" wrote: The Dictionary object is like a Collection object on steroids. You can do a Google search for... vb "dictionary object" to find out more, but here is a link to get you started... http://support.microsoft.com/kb/187234 -- Rick (MVP - Excel) "deltaquattro" wrote in message ... Hi Bernie, I'll try it - what's a dictionary? Couldn't find it in the book by Walkenbach. Thnx, Best Regards Sergio On 12 Feb, 18:14, "Bernie Deitrick" <deitbe @ consumer dot org wrote: For 2D non-numeric arrays, try either a dictionary object - great if you are loading a large file. Lots of samples available. HTH, Bernie MS Excel MVP "deltaquattro" wrote in message ... Hi guys! I'm creating a small library of utilities for VBA programming, and right now I'm completing my ArrayManagement and CollectionManagement module. I was considering different solutions for the classical case of searchin an array or collection for a specified elements. So far I've considered using Worksheetfunction.VLOOKUP, Worksheetfunction.Match (needs some care to take into account the "element not found" case) for the arrays. I also developed an handy binary search function for sorted arrays, but it works only for 1D numeric arrays (sorted in either nonincreasing or nondecreasing order) but I have no idea on how to extend it multiD/non numeric arrays (if that's possible at all). Also, I would like to find some smart "Is Nothing"-based trick for searching in a collection. and Any suggestion/alternatives? Thanks, Best Regards deltaquattro ps if anybody is interested, I can post my "rough" attempts at a solution. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Matching/Finding/Search Array Element | Excel Programming | |||
Rules for element-by-element product in array multiplication | Excel Programming | |||
delete element is collection | Excel Programming | |||
Search array and return element No | Excel Worksheet Functions | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming |