I get an excel spread sheet from a client that has cells showing hours and minutes separated with a decimal.
Say 40 hours, 59 minutes is displayed:
40.59
I need to convert that to decimal minutes so the above should become:
40.98
I found a formula online that does this conversion in another cell.
Can i create a vba script to run this formula on a range of cells and have the result of the formula overwrite the original cell's value?=IF(ISERROR(RIGHT(A1,LEN(A1)-FIND(".",A1)+1)),A1,LEFT(A1,FIND(".",A1)-1)+(ROUND((RIGHT(A1,LEN(A1)-FIND(".",A1)+1)/0.6),2)))
I've created the Range so far...
where do i go from here?Dim X As Range On Error Resume Next Set X = Application.InputBox(Prompt:="Select the [HH].MM cells", Title:="Time to Decimal", Type:=8)
Last edited by HeshMan; 08-26-2011 at 11:56 AM.
Welcome to the forum.
Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.
Thanks.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks