PC Review


Reply
Thread Tools Rate Thread

Displaying Number Only Once in a New List

 
 
cardan
Guest
Posts: n/a
 
      18th Oct 2006
Hello All,

I have a list of code numbers in a column in a master table. Some
repeat, some do not. I am trying create a new consolidated list from
the original list that will display each code that is used in the
master list only once. It would look something like this:

Master List

Code 555000
Code 555000
Code 555000
Code 111000
Code 111000
Code 222000
Code 555000
Code 333000

Into this

Code 555000
Code 111000
Code 222000
Code 333000

Is this possible? Any help would be greatly appreciated! Thank you in
advance for your time.

 
Reply With Quote
 
 
 
 
dolivastro@gmail.com
Guest
Posts: n/a
 
      18th Oct 2006
I think you need a VBA subroutine for that. I assume your master list
is in A1:A15, and you want the new list in B1:B15. Then you call the
subroutine as "Create_Unique (A1:a15, B1:B15). It looks like this
(untested)

public sub Create_unique (s a Range, e as Range)
dim i as long
dim j as long
dim w as long
dim Target as long

for i = s.Rows(1).Row to s.Rows(s.Rows.Count).Row
Target = s.Cells(i,1).Value
Status = IsUnique (Target, s, i+1)
if (Status) then
w = w + 1
e.Cells (w, 1).Value = Target
end if
next i
end sub


private function IsUnique (Target as long, s as Range, FirstRow as
long) as Boolean
dim i as long

for i = FirstRow to s.Rows(s.Rows.Count).Row
if (Target = s.Cells(i,1).Value) then
IsUnique = false
exit function
endif
next i

isUnique = true

end function


Hope this helps (and works)
Dom



cardan wrote:
> Hello All,
>
> I have a list of code numbers in a column in a master table. Some
> repeat, some do not. I am trying create a new consolidated list from
> the original list that will display each code that is used in the
> master list only once. It would look something like this:
>
> Master List
>
> Code 555000
> Code 555000
> Code 555000
> Code 111000
> Code 111000
> Code 222000
> Code 555000
> Code 333000
>
> Into this
>
> Code 555000
> Code 111000
> Code 222000
> Code 333000
>
> Is this possible? Any help would be greatly appreciated! Thank you in
> advance for your time.


 
Reply With Quote
 
smw226 via OfficeKB.com
Guest
Posts: n/a
 
      18th Oct 2006
Hi,

If you highlight your list then, Data>Filter>Advanced Filter

Check the "Unique Records" box and OK

That should take care of it.

Either that or create a pivot table on the codes, and that will have the same
effect.

HTH

Simon

cardan wrote:
>Hello All,
>
>I have a list of code numbers in a column in a master table. Some
>repeat, some do not. I am trying create a new consolidated list from
>the original list that will display each code that is used in the
>master list only once. It would look something like this:
>
>Master List
>
>Code 555000
>Code 555000
>Code 555000
>Code 111000
>Code 111000
>Code 222000
>Code 555000
>Code 333000
>
>Into this
>
>Code 555000
>Code 111000
>Code 222000
>Code 333000
>
>Is this possible? Any help would be greatly appreciated! Thank you in
>advance for your time.


--
--------------------
Simon - UK

Email at simon22mports [ a t ] hot mail [ d ot ]com

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200610/1

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report is displaying number from a list; not the value =?Utf-8?B?VHJhdmlz?= Microsoft Access 1 2nd Jan 2006 04:18 PM
combo box not displaying data if limit to list opetion set and displaying item not in list.... Chris Strug Microsoft Access Form Coding 4 3rd Oct 2003 03:44 PM
Re: Linking to a cell and displaying the formatted number, not the stored number Gail Microsoft Excel Misc 0 17th Jul 2003 03:34 PM
Re: Linking to a cell and displaying the formatted number, not the stored number Paul Corrado Microsoft Excel Misc 0 16th Jul 2003 10:00 PM
Re: Linking to a cell and displaying the formatted number, not the stored number John Wirt Microsoft Excel Misc 0 16th Jul 2003 09:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:49 PM.