Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Leading characters

Hi Everyone,

I would just like to get an explanation for the following, and if
possible a solution, using Excel 2000 with all SP's and hotfixes
applied.

We have our PABX call data dumped into a tab-delimitated text file,
which we import into excel, and using either Crystal Reports or Excel
create charts and various other reports, which works well for us...

However there is one small problem, the call time is imported from the
text file, as "' 00:00:25", which displays in the function bar in the
same format. However on cell displays as " 00:00:25". So why does the
leading "'" not show, and if I attempt a find/replace to remove the
leading "' " from the cell, it fails, because it can't find the string
in the cell. If you don't believe try this:
Open a new sheet in Excel 2000, put "' 00:00:18" into the first cell.
Now try to use find/replace to remove the leading "' " from that cell.
It doesn't work?

So is there a way around this? either by Macro or VBA? I thought bout
modifying the original ile, but "' " appears in other places which I
need to keep. I only need it removed from the call time column.

Also a more general question: when I set the contents of a cell to
"00:00:18" and set it format to time, it gets changed to 12:00:18 AM,
which in a sense is correct, but isn't the format I'm after. I need
the time as a quantive value rather than a clock time value, for
charting. ie phone extension 101 spent 12hrs 43 on STD calls this
month, which would be a sum of all the call times for extension 101.
How do I do this?

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Leading characters

the leading ' is treated as a formatting character. Thus it isn't
considered part of the cell.

Select your cells and run this macro:

Sub replaceit()
For Each cell In Selection
cell.Value = Trim(cell.Text)
Next
End Sub

This will convert the value to time values, however - hope that is what you
want.

It only displays in the formula bar as 12:00:18 AM, if it displays in the
cell that way, just format the cell to hh:mm:ss


It won't make any difference if you are performing math on the cells. Time
is stored as the fraction of a day. So an elapsed time is day zero plus the
fraction. 6 am = 0.25 for example. Format the cell as general and you
will see what I mean.


--
Regards,
Tom Ogilvy

Chewy509 wrote in message
om...
Hi Everyone,

I would just like to get an explanation for the following, and if
possible a solution, using Excel 2000 with all SP's and hotfixes
applied.

We have our PABX call data dumped into a tab-delimitated text file,
which we import into excel, and using either Crystal Reports or Excel
create charts and various other reports, which works well for us...

However there is one small problem, the call time is imported from the
text file, as "' 00:00:25", which displays in the function bar in the
same format. However on cell displays as " 00:00:25". So why does the
leading "'" not show, and if I attempt a find/replace to remove the
leading "' " from the cell, it fails, because it can't find the string
in the cell. If you don't believe try this:
Open a new sheet in Excel 2000, put "' 00:00:18" into the first cell.
Now try to use find/replace to remove the leading "' " from that cell.
It doesn't work?

So is there a way around this? either by Macro or VBA? I thought bout
modifying the original ile, but "' " appears in other places which I
need to keep. I only need it removed from the call time column.

Also a more general question: when I set the contents of a cell to
"00:00:18" and set it format to time, it gets changed to 12:00:18 AM,
which in a sense is correct, but isn't the format I'm after. I need
the time as a quantive value rather than a clock time value, for
charting. ie phone extension 101 spent 12hrs 43 on STD calls this
month, which would be a sum of all the call times for extension 101.
How do I do this?

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Leading characters

"Tom Ogilvy" wrote in message...
the leading ' is treated as a formatting character. Thus it isn't
considered part of the cell.

Select your cells and run this macro:

Sub replaceit()
For Each cell In Selection
cell.Value = Trim(cell.Text)
Next
End Sub

This will convert the value to time values, however - hope that is what you
want.

It only displays in the formula bar as 12:00:18 AM, if it displays in the
cell that way, just format the cell to hh:mm:ss


It won't make any difference if you are performing math on the cells. Time
is stored as the fraction of a day. So an elapsed time is day zero plus the
fraction. 6 am = 0.25 for example. Format the cell as general and you
will see what I mean.


Thanks Tom.
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Leading characters

I think your problem is that that "'" denotes that a
literal (or string) value follows. If you enter into a
cell "'=10/2" you will get the 'answer' "=10/2", not "5".
Make sense??

Thus, you can't use a standard find & replace easily.
You could use a really simple and nasty sub like...
Sub test()
ActiveCell.Formula = Right(ActiveCell.Formula, Len
(ActiveCell.Formula))
End Sub
which removes the "'". Turn this into a loop for your
range (or modify to something more suited to your app).

Marco
-----Original Message-----
Hi Everyone,

I would just like to get an explanation for the

following, and if
possible a solution, using Excel 2000 with all SP's and

hotfixes
applied.

We have our PABX call data dumped into a tab-delimitated

text file,
which we import into excel, and using either Crystal

Reports or Excel
create charts and various other reports, which works well

for us...

However there is one small problem, the call time is

imported from the
text file, as "' 00:00:25", which displays in the

function bar in the
same format. However on cell displays as " 00:00:25". So

why does the
leading "'" not show, and if I attempt a find/replace to

remove the
leading "' " from the cell, it fails, because it can't

find the string
in the cell. If you don't believe try this:
Open a new sheet in Excel 2000, put "' 00:00:18" into the

first cell.
Now try to use find/replace to remove the leading "' "

from that cell.
It doesn't work?

So is there a way around this? either by Macro or VBA? I

thought bout
modifying the original ile, but "' " appears in other

places which I
need to keep. I only need it removed from the call time

column.

Also a more general question: when I set the contents of

a cell to
"00:00:18" and set it format to time, it gets changed to

12:00:18 AM,
which in a sense is correct, but isn't the format I'm

after. I need
the time as a quantive value rather than a clock time

value, for
charting. ie phone extension 101 spent 12hrs 43 on STD

calls this
month, which would be a sum of all the call times for

extension 101.
How do I do this?

TIA
.

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
convert 5 characters in a cell to 6 characters by adding a zero Helenf Excel Discussion (Misc queries) 4 May 18th 09 04:43 PM
Insert Leading Characters If String Is Only 7 Characters Paperback Writer Excel Discussion (Misc queries) 2 April 21st 09 09:07 PM
In Excel find characters when multiple characters exist w/i a cel teacher-deburg Excel Worksheet Functions 1 December 5th 05 10:22 PM
HOW DO I EXTRACT ALL CHARACTERS AFTER 5 CHARACTERS ON LEFT GRYSYF Excel Worksheet Functions 5 October 12th 05 10:58 AM
leading 0 cb Excel Worksheet Functions 2 March 13th 05 01:50 PM


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

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

About Us

"It's about Microsoft Excel"