Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default cut off part of cell entry

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default cut off part of cell entry

try this sub
sub trimcells()
for each cel in selection
cel.value=trim(right(cel,len(cel)-2))
next cel
end sub
--
Don Guillett
SalesAid Software

"Orion" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default cut off part of cell entry


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


On Fri, 17 Dec 2004 08:29:59 -0600, "Don Guillett"
wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default cut off part of cell entry

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



On Mon, 20 Dec 2004 10:19:06 +0200, Orion wrote:


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


On Fri, 17 Dec 2004 08:29:59 -0600, "Don Guillett"
wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making the AND function look at only part of a cell entry Cathy Excel Discussion (Misc queries) 2 January 13th 10 06:56 PM
Formula Help with transferring middle part of a cell entry Paula Excel Discussion (Misc queries) 3 October 18th 07 02:38 PM
function to count the amount of cells depending on part of the cell entry Andyd74 Excel Worksheet Functions 5 May 25th 06 11:12 AM
matching part of an entry in a cell Andyd74 Excel Worksheet Functions 1 May 24th 06 06:00 PM
How do I work with part of a cell entry? JKB Excel Worksheet Functions 4 July 29th 05 11:09 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"