Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
comparing | Excel Discussion (Misc queries) | |||
how do i create chart like branch-sector sales & collections | Excel Discussion (Misc queries) | |||
minimize the file size in a ppt with collections of many pivot tables | Excel Discussion (Misc queries) | |||
Intersecting/Unioning Collections | Excel Programming | |||
Creating Collections 'on the fly' | Excel Programming |