Strings/suffix's in Excel

  • Thread starter Thread starter IainG
  • Start date Start date
I

IainG

Hello I wonder if someone can help, I am not an expert like most of you


I have a list of email addresses in Excel

eg;

column A
------------

ABC.COM
QWE.CO.UK
RTY.COM
AAA.SSS.COM
UIY.CO.UK
SHGD.AU
etc

What I would like to do automatically is to move all the ones suffixe
with .COM or .CO.UK to another column. I guess a macro is the bes
way.

Hope someone can enlighten me
 
something like this should move to the next column

sub movemover()
for each c in selection
if right(c,3)="COM" or right(c,2)="UK" then
c.cut c.offset(,1)
next
end sub
 
Hi

Thanks for a quick response. I tried that but got a error message whic
said

Compile error: Next Without for

Any idea
 
Sorry. Was in a hurry to leave the office and forgot the end if
sub movemover()
for each c in selection
if right(c,3)="COM" or right(c,2)="UK" then
c.cut c.offset(,1)
END IF
next
end sub
 

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