Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write Unique Values to New Worksheet

I have a worksheet that contains two columns of data, I need a macro that
will write unique values from the source worksheet to an existing worksheet.
The value is only considered to be unique if the combination of the two
values does not already exist in the target worksheet. The macro should run
each time the worksheet is opened.

Any help is much appreciated.

Regards,

John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Write Unique Values to New Worksheet

You could load the concatenation of each pair of the existing values into a
collection, then go through the new data, and try to add the concatenated
values to the collection. If you get an error, that row already exists. If
not, then copy the data to the bottom of an existing sheet.

You can see an example of using a collection to get a unique list at John
Walkenbach's site.
http://www.j-walk.com/ss/excel/tips/tip47.htm

You should be able to adapt that to your situation.

--
Regards,
Tom Ogilvy


"John_Carty" wrote in message
...
I have a worksheet that contains two columns of data, I need a macro that
will write unique values from the source worksheet to an existing

worksheet.
The value is only considered to be unique if the combination of the two
values does not already exist in the target worksheet. The macro should

run
each time the worksheet is opened.

Any help is much appreciated.

Regards,

John



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
Unique Values, not Unique Records steph44haf Excel Discussion (Misc queries) 1 May 12th 10 07:52 PM
Creating pick box with unique input values from a worksheet in the Tom Ogilvy Excel Programming 1 August 3rd 04 07:07 PM
VBA to write Unique Solutions ONLY? Michael[_27_] Excel Programming 3 May 22nd 04 05:41 PM
Using VBA, how to write unique solutions only? Michael[_27_] Excel Programming 0 May 6th 04 04:27 PM
Extract unique values from worksheet into form Gary[_9_] Excel Programming 1 August 28th 03 09:22 PM


All times are GMT +1. The time now is 05:46 AM.

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"