Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
How do I edit several formulas at one time in a worksheet? oneil15 Excel Worksheet Functions 2 July 8th 09 09:43 PM
Edit 2 workbooks at same time Pat Hughes Excel Discussion (Misc queries) 3 June 12th 09 09:40 PM
Edit Macro 1st time use sparx Excel Discussion (Misc queries) 1 March 12th 06 04:04 PM
run time error 1004 on protected worksheet when I try to run macro dtg_denver Excel Programming 13 August 13th 05 01:23 AM
macro to copy and edit then delete a worksheet lschuh Excel Discussion (Misc queries) 13 July 27th 05 09:02 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"