How to delete selected columns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
Columns(i).Delete
 

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