i dont know what is going on with your code, but i think using function like len
and mid may be easier. for example, you can loop this, but the logic would be
characternumber = len(cells.value) --this counts the number of characters in
your domain
for (row 1 to end)
characternumber = 0
counter = 0
for i = 1 to characternumber
if left(cell.value,i)=@
counter = counter +1 (counter should be set to 0 at the beginning of
each row loop)
exit for
else: counter = counter +1
end if
next
cells(1,2).value = mid(cell.value,counter,characternumber - counter) (i don't
know if the beginning of this code is correct, but what i'm trying to do is put
the domain name in the cell to the right of the current one)
next
the mid may be off by one character on either the first or second integer
numbers, which you can fix by adding a +1. you'll just need to experiment.