Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit time on worksheet
Hello,
I'm attempting to create a macro that either appends to a time or converts the value. Basically, I would like the macro to check the worksheet for times in a particular format, such as: :34 :45 :21 :00 This format does not allow me to add their values to create a total time. What I would like to do is create a macro that will check for values that are in this format, convert them to a 0:mm format (where 'mm' is the value of the time that was in there originally). Thanks for the help. Jason |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit time on worksheet
Sub AA()
For Each cell In Selection If cell.Text Like ":##" Then sStr = "0" & cell.Text cell.NumberFormat = "h:mm" cell.Value = sStr End If Next End Sub worked for me. If you sum up the cells using the sum formula, make sure you format the sum cell as a Time format. -- Regards, Tom Ogilvy wrote in message oups.com... Hello, I'm attempting to create a macro that either appends to a time or converts the value. Basically, I would like the macro to check the worksheet for times in a particular format, such as: :34 :45 :21 :00 This format does not allow me to add their values to create a total time. What I would like to do is create a macro that will check for values that are in this format, convert them to a 0:mm format (where 'mm' is the value of the time that was in there originally). Thanks for the help. Jason |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit time on worksheet
Worked like a charm...thanks for your help. Do you know any good sites
for advanced macro tutorials? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit time on worksheet
Tutorials, no. But there are plenty of sites with Advanced code.
Go to John Walkenbach's site and look at his links page (and his site as well) http://www.j-walk.com/ss/excel -- Regards, Tom Ogilvy "jason.banks" wrote in message oups.com... Worked like a charm...thanks for your help. Do you know any good sites for advanced macro tutorials? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I edit several formulas at one time in a worksheet? | Excel Worksheet Functions | |||
Edit 2 workbooks at same time | Excel Discussion (Misc queries) | |||
Edit Macro 1st time use | Excel Discussion (Misc queries) | |||
run time error 1004 on protected worksheet when I try to run macro | Excel Programming | |||
macro to copy and edit then delete a worksheet | Excel Discussion (Misc queries) |