iloc = Instr(1,activecell," ",vbTextcompare)
s = left(activecell,iloc-1)
activecell.offset(0,5).Value = s
if the part to remove is always 3 characters and a space
s = left(activecell,len(activecell)-4)
activecell.offset(0,5).value = s
--
Regards,
Tom Ogilvy
"Alastair79" wrote:
> I need to be able via a macro to copy only a portion of a cells contents to a
> different part of the sheet. What I have is like below:-
>
> "CLOBMIDDLETON PBL" or "CLOBDIDCOT PBL"
>
> I need to get ride of the "PBL" part and as you can see the first part of
> the cell varies in length. Is there any way to tell excel to copy till the
> space?
>
> Thanks............. Alastair.
Bookmarks