Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cells are changing format from numeric to date automatically | Excel Discussion (Misc queries) | |||
Changing time format | Excel Discussion (Misc queries) | |||
Can I convert numeric 0510 to time 05:10 by custom cell format? | Excel Discussion (Misc queries) | |||
Changing cell format - for example text to numeric | Excel Discussion (Misc queries) | |||
changing time format | Excel Programming |