cut off part of cell entry

  • Thread starter Thread starter Orion
  • Start date Start date
O

Orion

Hi there,

how can I cut off part of a cell entry?

cell entry: CA M 3
I would like to cut off the first two digits: CA

Thanks for any help

Regards,
Norbert
 
try this sub
sub trimcells()
for each cel in selection
cel.value=trim(right(cel,len(cel)-2))
next cel
end sub
 
Hi Don,

thanks very much for your hint, but I actually have to cut of
everything but the 2 digits on the left hand side. I should have made
myself a bit more clear. Sorry for that.

CA M 1 should become CA
PB Col 2 should become PB

I tried =trim(left(cel,len(cel)-4))
which works for the first example, but not for the second one, due to
the different entry length.

Regards,
Norbert
 
Oh no,
now I found out by myself. It's actually so easy!
=left(cel,2)
(this I will not forget anymore!)

Thanks anyway
Norbert
 

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