Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Changing this code

try this instead

Sub convtomiltime()
Dim c As Range
lr = Cells(Rows.Count, "f").End(xlUp).Row
For Each c In Range("f1:f" & lr)
If c < "" Then
c.Value = c - Int(c) * 24
c.NumberFormat = "HH:MM"
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"Neal" wrote in message
...
I wanted to know if this was right,
Dim rCell As Range
For Each rCell In Range( _
Range("f1:f1"), _
Cells(Rows.Count, "e").End(xlUp))
If rCell.Value < "" Then
rCell.FormulaR1C1 = "=(RC[-1] -INT(RC[-1]))*24"
End If
Next rCell
When I run it it takes the info and sets it to zero. I need it to take the
time in a1 and convert it to military time in b1, could someone please
help
me out, Thanks Neal.



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
Help with changing code Steve Excel Discussion (Misc queries) 3 March 2nd 09 04:03 PM
code for changing font Jack Sons Excel Discussion (Misc queries) 2 November 22nd 05 06:42 PM
Help with changing code Greg B[_4_] Excel Programming 2 March 13th 05 03:46 AM
Changing control properties/code through code Ajit Excel Programming 3 October 18th 04 09:03 PM
Changing code Erich Neuwirth Excel Programming 0 August 7th 04 02:27 PM


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

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"