MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Mar 30th, 2004, 12:07 PM   #1
jscholds
 
Join Date: Mar 2004
Location: London
Posts: 7
Default Identifying column headings, keep and delete

Hi all,

I would like to search and find column headings from a predefined list. When a column/s has been identified I would like to keep it/them and delete remaining ones.

Like..

Blue--Red--Orange--Green--Pink--Black--Yellow
1--------1------1--------1------1------1-------1
2--------2------2--------2------2------2-------2
3--------3------3--------3------3------3-------3
4--------4------4--------4------4------4-------4

In this example I want to keep columns called Red and Pink, but delete the rest. There is a catch though, the sheet won't have the same structure all the time i.e. in the example above Red is in column B and Pink in column E, this might change to A and M.

For the example above the macro would give me a sheet with...

Red--Pink
1-------1
2-------2
3-------3
4-------4

I know the names of the column headings I would like to find and I don't mind copying columns to a new sheet if that is that is necessary.

At the moment I program the macro individually to fit the structure of the excel sheet I am currently working using, however it takes time there and manual delete increases chance for errors.

Running W2000 on excel 2000.

Hope someone can help..

Jakob
jscholds is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

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 On

Forum Jump


All times are GMT +1. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.