Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Changing time format to numeric

Thanks for all the responses but they unfortunately still don't resolve my
problem. While this works fine when modifying Excel manually on the
worksheet, I need to be able to do it with the use of code which so far I
have been unable to do.

The code I tried was
xlApp.Application.Range(A8:H38) = xlApp.Application.Range(Cells(8, 8),
Cells(36, 8)).Value *24

Also the range to be changed is not actually A8:H36 - it is A8 to end of
file as all the worksheets are of different length with differing amounts of
rows. Any ideas on what I'm doing wrong guys?

"Andrew Taylor" wrote:

Multiply by 24 and format as General.

Geoff wrote:
How do I programatically change a derived time format displayed as 8:00:00
(hours - derived from a formula finish time minus start time) to the numeric
format 8 in a cell - can it be done?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Changing time format to numeric

Hi

You can multiply in this way the value in single cell. To do so with a
range, you or cycle through cells in range, and multiply every cell value
with 24 separately, or you use an VBA equivalent for a technique, where you
copy some cell with value 24 in it, and then use PasteSpecialMultiply on a
range with time values.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"Geoff" wrote in message
...
Thanks for all the responses but they unfortunately still don't resolve my
problem. While this works fine when modifying Excel manually on the
worksheet, I need to be able to do it with the use of code which so far I
have been unable to do.

The code I tried was
xlApp.Application.Range(A8:H38) = xlApp.Application.Range(Cells(8, 8),
Cells(36, 8)).Value *24

Also the range to be changed is not actually A8:H36 - it is A8 to end of
file as all the worksheets are of different length with differing amounts
of
rows. Any ideas on what I'm doing wrong guys?

"Andrew Taylor" wrote:

Multiply by 24 and format as General.

Geoff wrote:
How do I programatically change a derived time format displayed as
8:00:00
(hours - derived from a formula finish time minus start time) to the
numeric
format 8 in a cell - can it be done?





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
Cells are changing format from numeric to date automatically Amy Excel Discussion (Misc queries) 1 January 14th 10 08:59 PM
Changing time format doodle302 Excel Discussion (Misc queries) 2 January 14th 10 09:56 AM
Can I convert numeric 0510 to time 05:10 by custom cell format? Rita_H Excel Discussion (Misc queries) 4 July 27th 06 01:41 PM
Changing cell format - for example text to numeric sjrku Excel Discussion (Misc queries) 3 December 30th 05 10:40 PM
changing time format JT[_2_] Excel Programming 2 May 17th 04 10:23 PM


All times are GMT +1. The time now is 11:11 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"