Calculate total hours from time cards in Excel. Quick calculations from in and out times on a pay card. Check out my online courses www.easyexcelanswers.com/courses.html
All my courses include online support and a user manual
Let me teach you the VBA that I have learn in my five years of consulting
Let’s take the frustration out of user forms
Become an Affiliate and earn 25% on Course Sales
For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting
I am able to provide online help on your computer at a reasonable rate.
I use a Blue condenser Microphone to record my videos, here is the link
Check out Crowdcast for creating your webinars
If you need to buy Office 2019 follow
I use Tube Buddy to help promote my videos
Check them out
Follow me on Facebook
TWEET THIS VIDEO
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
Code
Sub totaltime()
Dim r, c As Long
Dim ATotal, Ptotal As Double
Dim gTotal As Double
Dim weektot, runtot As Double
Dim Timein, Timin2 As Date
Dim Timeout, Timeout2 As Date
r = 10
c = 4
For r = 10 To 16
Sheet1.Cells(r, c).Select
ActiveCell.NumberFormat = “hh:mm:ss AM”
Sheet1.Cells(r, 5).NumberFormat = “hh:mm:ss”
‘———- morning———
Timein = CDate(Cells(r, 4).Value)
Timeout = CDate(Cells(r, 5).Value)
Total = TimeValue(Timeout) – TimeValue(Timein)
Debug.Print Total
Debug.Print Format(Total, “hh:mm:ss”)
Cells(r, 8).NumberFormat = “hh:mm:ss”
Cells(r, 8).Value = Total
‘———–Afternoon—————–
Sheet1.Cells(r, 6).NumberFormat = “hh:mm:ss”
Sheet1.Cells(r, 7).NumberFormat = “hh:mm:ss”
Timein2 = CDate(Cells(r, 6).Value)
Timeout2 = CDate(Cells(r, 7).Value)
ATotal = TimeValue(Timeout2) – TimeValue(Timein2)
Debug.Print ATotal
Debug.Print Format(ATotal, “hh:mm:ss”)
Cells(r, 9).NumberFormat = “hh:mm:ss”
Cells(r, 9).Value = ATotal
‘———-Day total—————
gTotal = Total + ATotal
Debug.Print gTotal
Debug.Print Format(gTotal, “hh:mm:ss”)
Cells(r, 10).NumberFormat = “hh:mm:ss”
Cells(r, 10).Value = gTotal
runtot = Range(“J20”).Value + gTotal
‘———–Running total for week———
Range(“J20”).Value = runtot
Range(“J20”).NumberFormat = “[h]:mm:ss”
Next r
End Sub
Watch more new videos about Excel Office | Synthesized by Mindovermetal English
Hii ma'am I'm Praveen Sharma from India I'm not very good learning, I'm security officer in our company but I have not knowledge in Excel, but really subscribe your channel from before long time, now I want to learn.please help me. Thanks ma'am.