View Single Post
 
Old 01-16-2012, 04:13 PM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Loop through listboxes in Application.OrganizerCopy (II)

The Target listbox (Listbox3) needs a filter in the Sub CmdTarget_Click module to remove duplicate file names (unless their folders are unique). The way it works now is if the list is empty and I select one file from a source folder, that file appears in the list (as it should). If I select the same file from the same source folder, nothing happens, but if I select the same file from the source AGAIN, it is appended to the listbox. This produces two listings of the same file - this is not what I want. If there is at least one item in Listbox3 and I select a different file TWICE (same file name), that file will appear twice in the listbox.

I would like to be able to select any files in any folder and have the code filter by filename AND folder name, so that the same filename can appear in the list more than once, but only if each is contained in a different folder. Otherwise, there can be no duplication of the filename.

I found some code online that filters for unique items in a listbox at http://www.tech-archive.net/Archive/.../msg00199.html, but I cannot get it to work in the Style Copier. I'm sure this is because of my great lack of VBA skill but may be partly because its Listbox3 is two columns and I doubt that online code will work for two columns. Have attached the latest version of Style Copier and would appreciate assistance.
Attached Files
File Type: doc Style Copier Application (Jan 15 2012).doc (134.5 KB, 26 views)
Reply With Quote