ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to remove characters from a cell (https://www.excelbanter.com/excel-programming/337601-how-remove-characters-cell.html)

Jonathan Dunne

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



Andibevan[_4_]

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





Paul Black

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



Norman Jones

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





All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com