ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Writing a macro to bring back distinct value (https://www.excelbanter.com/excel-programming/299251-writing-macro-bring-back-distinct-value.html)

Sean[_7_]

Writing a macro to bring back distinct value
 
I have a spreadsheet contains values in columns H, I and J.

I do not want the data in columns I and J so I want them
deleted, however, I do want some of the data in column H.
A number of the values appear more than once but all i
want is a list of distinct values from that row.

Any ideas as to how to go about this ?

Thanks

Frank Kabel

Writing a macro to bring back distinct value
 
Hi
see:
http://www.cpearson.com/excel/duplic...tractingUnique
-----Original Message-----
I have a spreadsheet contains values in columns H, I and

J.

I do not want the data in columns I and J so I want them
deleted, however, I do want some of the data in column

H.
A number of the values appear more than once but all i
want is a list of distinct values from that row.

Any ideas as to how to go about this ?

Thanks
.


Tushar Mehta

Writing a macro to bring back distinct value
 
Turn on the macro recorder (Tools | Macro Record new macro...), do
the following, turn off the recorder, and switch to the VBE. XL will
give you the necessary code.

Select columns I and J and delete them.

Select any cell in column H that contains data and select Data | Filter
Advanced Filter...


In the dialog box, specify Unique records only and 'Copy to another
location.' Specify the other location as column I.

Once XL completes the filter, select column H and delete it.

Turn off the recorder.

If you would like help customizing or generalizing the code post it in
a follow up message and someone should be able to help you.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I have a spreadsheet contains values in columns H, I and J.

I do not want the data in columns I and J so I want them
deleted, however, I do want some of the data in column H.
A number of the values appear more than once but all i
want is a list of distinct values from that row.

Any ideas as to how to go about this ?

Thanks



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

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