View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Luo John Luo is offline
external usenet poster
 
Posts: 1
Default How to delete selected columns?

Here's my example:
2006 2006 2005 2005 2004 2004
Name you(me) you you(me) you you(me) you

I want to delete the columns that the names are "you(me)"
I write the code as follows:

for i=1 to 6
if cells(2,i)="*me*" then
columns.select
selections.delect
i=i-1
end if
next i


but nothing changed when I run the code
what's wrong with that?
is it proper for me to use cells(2,i)="*me*" to find anything that has the
string"me"?
thank you!