Solved

Convert Duration

Posted on 2012-03-09
3
236 Views
Last Modified: 2012-03-09
Hi Experts,

Please help create VBA to convert all "00:50" duration into "02:00" at column D. Attached the workbook.
Convert-Duration.xls
0
Comment
Question by:Billa7
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 37702782
Sub convertduration()
Dim cel As Range
For Each cel In Range("D2:D" & Range("D2").End(xlDown).Row)
If cel.Value = 50 / 24 / 60 Then cel = 2 / 24
cel.NumberFormat = "h:mm"
Next cel
End Sub
0
 

Author Closing Comment

by:Billa7
ID: 37702797
Hi ssaqibh,

Thanks
0
 

Author Comment

by:Billa7
ID: 37702893
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question