I am currently trying to reduce hundreds of columns of data using a macro in Excel 2007. Currently, my macro defines certain columns (A, B, C) to delete. However, every time we collect new data, the columns may change. Instead of selecting a column based on its letter and deleting it, I was wondering if you could:
- Find a column based on it's title (ex. find by title "CBPR1" instead of "Column A")
- Define the names of all of the columns I would like to keep instead of delete (ex. find and keep "CBPR1, CBPR2, etc." instead of find and delete "Column A, B, etc.")
Just to make it more clear, and example is if CPBR1 is now in Column B instead of AA. I just want to alter my code so that I only need to define which columns I want to keep based on the text in the first line, rather than the column letter. I would also like to keep all of the columns I define and delete everything else instead of the other way around. Thanks
Bookmarks