Writing a macro to bring back distinct value

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top