View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Deleting Column Based On Header

Name the keepers and write the code to delete all columns except the keepers.

"David A." wrote:

I have a spreadsheet that people keep adding columns to. I import this sheet
and I have a macro that I hide the unwanted columns. The problem is that I
have to re-write the macro every time they add another (or change) column. I
need to write a macro that will delete the unwanted columns without
re-writing the macro.
EX:
"Column1" "Column2 "Column3"
I want to keep Column1 and Column3 and delete Column2 no matter what its
name or possition.