ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get only unique values? (https://www.excelbanter.com/excel-programming/385367-get-only-unique-values.html)

Ed

Get only unique values?
 
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?

Ed


Tom Ogilvy

Get only unique values?
 
select the column (make sure it has a header in row 1)

then do Data=filterAdvanced filter

Select Filter in place and click the Unique checkbox in the lower left.

You don't need to specify a criteria.

to restore your list, do

Data=filter=Showall

--
Regards,
Tom Ogilvy


"Ed" wrote:

I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?

Ed



Ed

Get only unique values?
 
Tom: I'm sorry I wasn't clearer. I'm copying new info into an
exisiting workbook. When I'm done, I need to print out the unique
values from one column over the range of rows I just copied into.
Say, Col J, Rows 135 - 210. Can I set
Range("J135:J210") and get just the unique values from there to print
out?

Ed

On Mar 15, 10:31 am, Tom Ogilvy
wrote:
select the column (make sure it has a header in row 1)

then do Data=filterAdvanced filter

Select Filter in place and click the Unique checkbox in the lower left.

You don't need to specify a criteria.

to restore your list, do

Data=filter=Showall

--
Regards,
Tom Ogilvy



"Ed" wrote:
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?


Ed- Hide quoted text -


- Show quoted text -




Tom Ogilvy

Get only unique values?
 
You haven't told me anything that would change the basic advice.

If you want to print out, then after applying the filter just select
J135:J210 and print selection. only the visible rows will be printed.

You can apply the autofilter with code if that is your consternation.

Assume you header row is in J134

Dim rng as Range
set rng = Range(Range("J134),Range("J134").end(xldown))
rng.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
rng.Printout
Activesheet.ShowAllData

--
Regards,
Tom Ogilvy




--
Regards,
Tom Ogilvy


"Ed" wrote:

Tom: I'm sorry I wasn't clearer. I'm copying new info into an
exisiting workbook. When I'm done, I need to print out the unique
values from one column over the range of rows I just copied into.
Say, Col J, Rows 135 - 210. Can I set
Range("J135:J210") and get just the unique values from there to print
out?

Ed

On Mar 15, 10:31 am, Tom Ogilvy
wrote:
select the column (make sure it has a header in row 1)

then do Data=filterAdvanced filter

Select Filter in place and click the Unique checkbox in the lower left.

You don't need to specify a criteria.

to restore your list, do

Data=filter=Showall

--
Regards,
Tom Ogilvy



"Ed" wrote:
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?


Ed- Hide quoted text -


- Show quoted text -





Ed

Get only unique values?
 
Okay - I think I see. I get an idea of what I think I need to do, and
I get tunnel-visioned on that. So if my header is in Row 1, I apply
the filter, then just select the range of rows I've just been working
with in my code and print.

Thanks, Tom. I appreciate the boost.
Ed

On Mar 15, 11:39 am, Tom Ogilvy
wrote:
You haven't told me anything that would change the basic advice.

If you want to print out, then after applying the filter just select
J135:J210 and print selection. only the visible rows will be printed.

You can apply the autofilter with code if that is your consternation.

Assume you header row is in J134

Dim rng as Range
set rng = Range(Range("J134),Range("J134").end(xldown))
rng.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
rng.Printout
Activesheet.ShowAllData

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy



"Ed" wrote:
Tom: I'm sorry I wasn't clearer. I'm copying new info into an
exisiting workbook. When I'm done, I need to print out the unique
values from one column over the range of rows I just copied into.
Say, Col J, Rows 135 - 210. Can I set
Range("J135:J210") and get just the unique values from there to print
out?


Ed


On Mar 15, 10:31 am, Tom Ogilvy
wrote:
select the column (make sure it has a header in row 1)


then do Data=filterAdvanced filter


Select Filter in place and click the Unique checkbox in the lower left.


You don't need to specify a criteria.


to restore your list, do


Data=filter=Showall


--
Regards,
Tom Ogilvy


"Ed" wrote:
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?


Ed- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




Tom Ogilvy

Get only unique values?
 
Yes.

--
Regards,
Tom Ogilvy


"Ed" wrote:

Okay - I think I see. I get an idea of what I think I need to do, and
I get tunnel-visioned on that. So if my header is in Row 1, I apply
the filter, then just select the range of rows I've just been working
with in my code and print.

Thanks, Tom. I appreciate the boost.
Ed

On Mar 15, 11:39 am, Tom Ogilvy
wrote:
You haven't told me anything that would change the basic advice.

If you want to print out, then after applying the filter just select
J135:J210 and print selection. only the visible rows will be printed.

You can apply the autofilter with code if that is your consternation.

Assume you header row is in J134

Dim rng as Range
set rng = Range(Range("J134),Range("J134").end(xldown))
rng.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
rng.Printout
Activesheet.ShowAllData

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy



"Ed" wrote:
Tom: I'm sorry I wasn't clearer. I'm copying new info into an
exisiting workbook. When I'm done, I need to print out the unique
values from one column over the range of rows I just copied into.
Say, Col J, Rows 135 - 210. Can I set
Range("J135:J210") and get just the unique values from there to print
out?


Ed


On Mar 15, 10:31 am, Tom Ogilvy
wrote:
select the column (make sure it has a header in row 1)


then do Data=filterAdvanced filter


Select Filter in place and click the Unique checkbox in the lower left.


You don't need to specify a criteria.


to restore your list, do


Data=filter=Showall


--
Regards,
Tom Ogilvy


"Ed" wrote:
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?


Ed- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





Tom Ogilvy

Get only unique values?
 
But just to add,
then unique would be relative to the whole column. If that is problematic
it is trivial in code to insert a row at 135, put in a "Header", apply the
advanced filter to J135:J211 (one cell down), print, remove the filter,
delete the row.

--
Regards,
Tom Ogilvy


"Ed" wrote:

Okay - I think I see. I get an idea of what I think I need to do, and
I get tunnel-visioned on that. So if my header is in Row 1, I apply
the filter, then just select the range of rows I've just been working
with in my code and print.

Thanks, Tom. I appreciate the boost.
Ed

On Mar 15, 11:39 am, Tom Ogilvy
wrote:
You haven't told me anything that would change the basic advice.

If you want to print out, then after applying the filter just select
J135:J210 and print selection. only the visible rows will be printed.

You can apply the autofilter with code if that is your consternation.

Assume you header row is in J134

Dim rng as Range
set rng = Range(Range("J134),Range("J134").end(xldown))
rng.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
rng.Printout
Activesheet.ShowAllData

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy



"Ed" wrote:
Tom: I'm sorry I wasn't clearer. I'm copying new info into an
exisiting workbook. When I'm done, I need to print out the unique
values from one column over the range of rows I just copied into.
Say, Col J, Rows 135 - 210. Can I set
Range("J135:J210") and get just the unique values from there to print
out?


Ed


On Mar 15, 10:31 am, Tom Ogilvy
wrote:
select the column (make sure it has a header in row 1)


then do Data=filterAdvanced filter


Select Filter in place and click the Unique checkbox in the lower left.


You don't need to specify a criteria.


to restore your list, do


Data=filter=Showall


--
Regards,
Tom Ogilvy


"Ed" wrote:
I have a range -one single single column. I'd like to print only the
unique values in this range. What's the best method to use to get the
unique values?


Ed- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





Ed

Get only unique values?
 
Yes, I see that - now! 8{ Stupid blinders!

Thanks, Tom. Just one more thing I've learned from you.
Ed


On Mar 15, 12:40 pm, Tom Ogilvy
wrote:
But just to add,
then unique would be relative to the whole column. If that is problematic
it is trivial in code to insert a row at 135, put in a "Header", apply the
advanced filter to J135:J211 (one cell down), print, remove the filter,
delete the row.

--
Regards,
Tom Ogilvy




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com