Track the percent of each shift staff are working in Excel



Track the percent of each shift staff are working in Excel. 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.

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

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 daysoff()
Dim sat As Long
Dim startpos As Range
Dim secwk As Integer
Dim rng As Range
Dim fstwk As Long
Dim findstring As String
Dim thrdwk As Long
Dim fourwk As Long
Dim cnt As Long
Dim r, c As Long

sat = 7
findstring = sat
With ActiveSheet.Range(“b3:I3”)
Set rng = .Find(What:=findstring, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)

End With

fstwk = (rng.Column)
secwk = (fstwk + 7)
thrdwk = fstwk + 14
fourwk = fstwk + 21

For r = 7 To 26

If (r = 7 Or r = 11 Or r = 15 Or r = 19 Or r = 23) Then
fstwk = (rng.Column)
cnt = 0
Do While cnt (is less than) 1
ActiveSheet.Cells(r, fstwk) = “O”
ActiveSheet.Cells(r, fstwk).Offset(0, 1) = “O”
Set startpos = ActiveSheet.Cells(r, fstwk)
startpos.Offset(0, 5).Value = “O”
startpos.Offset(0, 10).Value = “O”
startpos.Offset(0, 13).Value = “O”
startpos.Offset(0, 16).Value = “O”
startpos.Offset(0, 20).Value = “O”
startpos.Offset(0, 25).Value = “O”
cnt = cnt + 1
fstwk = fstwk + 28
Loop

End If
If (r = 8 Or r = 12 Or r = 16 Or r = 20 Or r = 24) Then
fstwk = (rng.Column)
secwk = (fstwk + 7)
cnt = 0
Do While cnt (is less than) 1
ActiveSheet.Cells(r, secwk) = “O”
ActiveSheet.Cells(r, secwk).Offset(0, 1) = “O”

Set startpos = ActiveSheet.Cells(r, secwk)
startpos.Offset(0, -3).Value = “O”
startpos.Offset(0, 5).Value = “O”
startpos.Offset(0, 10).Value = “O”
startpos.Offset(0, 13).Value = “O”
startpos.Offset(0, 16).Value = “O”
startpos.Offset(0, 19).Value = “O”
cnt = cnt + 1
secwk = secwk + 28
Loop
End If

If (r = 9 Or r = 13 Or r = 17 Or r = 21 Or r = 25) Then
fstwk = (rng.Column)
secwk = (fstwk + 7)
thrdwk = fstwk + 14
cnt = 0
Do While cnt (is less than) 1
ActiveSheet.Cells(r, thrdwk) = “O”
ActiveSheet.Cells(r, thrdwk).Offset(0, 1) = “O”
Set startpos = ActiveSheet.Cells(r, thrdwk)
startpos.Offset(0, -3).Value = “O”
startpos.Offset(0, -8).Value = “O”
startpos.Offset(0, -12).Value = “O”
startpos.Offset(0, 5).Value = “O”
startpos.Offset(0, 10).Value = “O”
startpos.Offset(0, 12).Value = “O”
cnt = cnt + 1
thrdwk = thrdwk + 28
Loop
End If

If (r = 10 Or r = 14 Or r = 18 Or r = 22 Or r = 26) Then
fstwk = (rng.Column)
secwk = (fstwk + 7)
thrdwk = fstwk + 14
fourwk = fstwk + 21
cnt = 0
Do While cnt (is less than) 1
ActiveSheet.Cells(r, fourwk) = “O”
ActiveSheet.Cells(r, fourwk).Offset(0, 1) = “O”
Set startpos = ActiveSheet.Cells(r, fourwk)
startpos.Offset(0, -3).Value = “O”
startpos.Offset(0, -8).Value = “O”
startpos.Offset(0, -12).Value = “O”
startpos.Offset(0, -15).Value = “O”
startpos.Offset(0, -18).Value = “O”
startpos.Offset(0, 6).Value = “O”
cnt = cnt + 1
fourwk = fourwk + 28
Loop
End If
Next r

End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận