Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Comparing Collections

Load your listbox in either case as if it was being loaded for the first
time.

Then loop through the list and populate the second column with values from
your stored list where there is a match in first column.

I wouldn't even make it an option. The user can edit the existing values
if they want to change something.

--
Regards,
Tom Oglivy

"Stuart" wrote in message
...
The values in col 1 of a multicol lisbox have been loaded
from a sorted Collection. Against these values the user
has entered their 'real' names in col 2. The contents of both
cols are saved to a sheet (DataStore) in the user's workbook.
That's first time through.

Second time through, the user will probably have made minor
amendments to to the cells whose contents will eventually end
up in col 1. I need to check for this, but also to save the user
from having to retype all the col 2 values again.

Workbooks(wkbkname).Activate
If SheetExists("DataStore", ActiveWorkbook) = True Then
' sheet exists
If MsgBox("Do you wish to use previous SubContractor/Suppliers" & _
vbNewLine & " or rename them again?", vbYesNo) = vbYes Then
frmName_Contractors.lbDataCode.List = Worksheets("DataStore") _
.Range("A1").CurrentRegion.Value
End If
Else
' Add the sorted, non-duplicated items to a ListBox
For Each Item In mstrList
frmName_Contractors.lbDataCode.AddItem Item
Next Item
End If

frmName_Contractors.Show ''vbModeless

This is an either or situation.... user either accepts old values or opts
for the new. If the old, then new 'tags' are missed. If the new, then
there's much typing to be done.

Is there a way to ensure ALL values from mstrList load into col 1
of frmName_Contractors.lbDataCode, together with ANY col B
values (into lisbox col 2) that are commonally found in DataStore?

So if first time through a 'tag' of H was in listbox 1 with a 'real' name

of
Concrete, then it will be found in DataStore. If 2nd time through 'H' is
found....how do I load Concrete against H in listbox 2.

Hope that's not as confusing as it seems to me!

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Comparing Collections

Regards and thanks.

"Tom Ogilvy" wrote in message
...
Load your listbox in either case as if it was being loaded for the first
time.

Then loop through the list and populate the second column with values

from
your stored list where there is a match in first column.

I wouldn't even make it an option. The user can edit the existing values
if they want to change something.

--
Regards,
Tom Oglivy

"Stuart" wrote in message
...
The values in col 1 of a multicol lisbox have been loaded
from a sorted Collection. Against these values the user
has entered their 'real' names in col 2. The contents of both
cols are saved to a sheet (DataStore) in the user's workbook.
That's first time through.

Second time through, the user will probably have made minor
amendments to to the cells whose contents will eventually end
up in col 1. I need to check for this, but also to save the user
from having to retype all the col 2 values again.

Workbooks(wkbkname).Activate
If SheetExists("DataStore", ActiveWorkbook) = True Then
' sheet exists
If MsgBox("Do you wish to use previous SubContractor/Suppliers" & _
vbNewLine & " or rename them again?", vbYesNo) = vbYes Then
frmName_Contractors.lbDataCode.List = Worksheets("DataStore") _
.Range("A1").CurrentRegion.Value
End If
Else
' Add the sorted, non-duplicated items to a ListBox
For Each Item In mstrList
frmName_Contractors.lbDataCode.AddItem Item
Next Item
End If

frmName_Contractors.Show ''vbModeless

This is an either or situation.... user either accepts old values or

opts
for the new. If the old, then new 'tags' are missed. If the new, then
there's much typing to be done.

Is there a way to ensure ALL values from mstrList load into col 1
of frmName_Contractors.lbDataCode, together with ANY col B
values (into lisbox col 2) that are commonally found in DataStore?

So if first time through a 'tag' of H was in listbox 1 with a 'real'

name
of
Concrete, then it will be found in DataStore. If 2nd time through 'H' is
found....how do I load Concrete against H in listbox 2.

Hope that's not as confusing as it seems to me!

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003


Reply
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
comparing pierre Excel Discussion (Misc queries) 2 May 6th 10 06:02 AM
how do i create chart like branch-sector sales & collections Gnana Prasad Excel Discussion (Misc queries) 1 January 11th 08 08:00 AM
minimize the file size in a ppt with collections of many pivot tables chermaine Excel Discussion (Misc queries) 1 December 30th 05 11:04 AM
Intersecting/Unioning Collections Robbie[_2_] Excel Programming 3 September 13th 03 08:09 PM
Creating Collections 'on the fly' Dave Peterson[_3_] Excel Programming 4 September 6th 03 07:20 AM


All times are GMT +1. The time now is 12:27 AM.

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

About Us

"It's about Microsoft Excel"