LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default List of data?

Robert Crandal has brought this to us :
Sure, I probably wasnt very clear, so I'll try to just give
the basic gist of what I need.

I was basically wondering if Visual Basic for Excel 2007 has
some sort of data type that can hold a "set" of unique strings.
I would like to be able to add or remove strings from this set
and possibly iterate through the set of strings to see what the
set contains.

I realize that I could use an array of strings to implement a set of
of strings, but that seems to be overkill and possibly time consuming.
So, I'm basically wondering if Visual Basic provides some sort
of a "set" data type or datastructure?? Does that make sense?

Robert


Hi Robert,

That's a bit more helpful but doesn't answer my Q about a 'linked
list'. There is no data type that holds a 'set' of values as you
describe. There are structures you could use to store and manipulate
sets of data; namely an Array() or a Collection would be first chioces
for unknown values/size at runtime. Both of these would let you
add/remove/change the data however required. In both cases, you might
want to store the data in a file (possibly encrypted) so it can be
retrieved at startup and saved at shutdown.

The UDT structure might work for known members at design time but you
can only change the values at runtime (ergo you can't add/remove
members at runtime).

The easiest approach <IMO would be to use a variable defined as
Variant data type. This would allow you to manipulate the data using
VB[A]'s Split() and Join() functions as well as the Filter() function
to remove blank elements resulting from deleted data. I'd use a
delimited string for each record of data so it fits nicely into a one
dim array. Parsing each record is fairly easy and straight forward
using the Split() function.

Optionally, depending on how the storage is structured, you could use
ADO to manage the data in 'sets' based on criteria you define.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use VBA to reset data validation (=list) value to first value in that list (list is a named range) ker_01 Excel Programming 7 October 27th 08 03:13 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 4 May 1st 07 05:49 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 2 April 29th 07 11:09 PM
How to view a list of data based on another list of data Adnan Excel Discussion (Misc queries) 3 April 10th 07 05:22 PM
converting vertical data list to horizontal data list tjb Excel Worksheet Functions 2 July 15th 06 02:17 AM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"