Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to remove characters from a cell

Hi all

I have a bunch of cells which contain both date and time e.g.

08/16/2005 18:38:32.300
08/16/2005 18:38:32.315
08/16/2005 18:38:34.308

I am wondering what is the correct procedure to remove the first 11
characters from each cell? I can't do a simple find and replace as the date
will change.

Thanks in advance
Jonathan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default How to remove characters from a cell

Dim AnyString, MyStr
AnyString = "08/16/2005 18:38:32.300" ' Define string.
MyStr = Left(AnyString, 11)

HTH

Andi

"Jonathan Dunne" wrote in message
...
Hi all

I have a bunch of cells which contain both date and time e.g.

08/16/2005 18:38:32.300
08/16/2005 18:38:32.315
08/16/2005 18:38:34.308

I am wondering what is the correct procedure to remove the first 11
characters from each cell? I can't do a simple find and replace as the

date
will change.

Thanks in advance
Jonathan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default How to remove characters from a cell

Hi Jonathan,

Try this Formula, Change the References Accordingly :-

=TRIM(RIGHT(A1,LEN(A1)-IF(ISERROR(FIND(" ",A1,FIND(" ",A1,FIND("
",A1,1)))),LEN(A1),FIND(" ",A1,FIND(" ",A1,FIND(" ",A1,1)))-1)))

All the Best.
Paul



Jonathan Dunne wrote:
Hi all

I have a bunch of cells which contain both date and time e.g.

08/16/2005 18:38:32.300
08/16/2005 18:38:32.315
08/16/2005 18:38:34.308

I am wondering what is the correct procedure to remove the first 11
characters from each cell? I can't do a simple find and replace as the date
will change.

Thanks in advance
Jonathan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to remove characters from a cell

Hi Jonathan,

If you want to display just the time in the original cells, format the cells
with a custom format:

hh:mm:ss

If you want to leave the original cells unchanged, but extract just the time
portion to another cell, then, in the destination cell enter the formula:

=A1-INT(A1)

where A1 is the original cell. Format the destination cells using the custom
format above.

If you want to convert the destination cells to static time values, select
the destination cells and Edit | Copy | PasteSpecial | Values.


---
Regards,
Norman



"Jonathan Dunne" wrote in message
...
Hi all

I have a bunch of cells which contain both date and time e.g.

08/16/2005 18:38:32.300
08/16/2005 18:38:32.315
08/16/2005 18:38:34.308

I am wondering what is the correct procedure to remove the first 11
characters from each cell? I can't do a simple find and replace as the
date will change.

Thanks in advance
Jonathan



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
How do I remove the last 4 characters within a cell Problem poser Excel Discussion (Misc queries) 5 April 3rd 23 07:42 PM
How do I remove new line characters from a cell? cathyc Excel Discussion (Misc queries) 1 July 13th 09 09:28 PM
Remove Characters from a cell Kim Excel Worksheet Functions 8 June 1st 06 05:21 PM
remove non-numeric characters from a cell SWBodager Excel Discussion (Misc queries) 14 December 16th 05 07:49 PM
remove last three characters of cell mira Excel Discussion (Misc queries) 8 July 28th 05 12:06 AM


All times are GMT +1. The time now is 01:00 PM.

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"