Select both number of people and shifts for schedule in Excel
Barb Henderson
0:00 / 0:00
Select both number of people and shifts for schedule in Excel
3 339 просмотров · 7 л. назад
Barb Henderson
41,4 тыс. подписчиков
3 339 просмотров · 7 л. назад
Select both number of people and shifts for schedule in Excel. This schedule allows you to select the number of people for each of your locations. You are able to select both the number of people and the number of shifts for each locations. You are able leave locations blank if the location is not active for this month.
code
Check out my online courses https://barb-s-school-c482.thinkific....
Private Sub CommandButton1_Click()
Dim i, sat As Integer
Dim startpos As Range
Dim y, z As Integer
Dim sdate As Date
Dim edate As Date
Dim ex As Integer
Dim A, AR As Integer
Dim ARS As Integer
Dim B, BR As Integer
Dim BRS As Integer
Dim C, CR As Integer
Dim CRS As Integer
Dim D, DR As Integer
Dim DRS As Integer
Dim E, ER As Integer
Dim ERS As Integer
sdate = Worksheets("sheet1").Cells(1, 3)
edate = Worksheets("sheet1").Cells(1, 10)
ex = (edate - sdate) + 1
'UserForm1.Show
If (R1.Text) = "" Then
GoTo b1cnt
Else
A = R1.Text + 4
AR = R1S.Text
ARS = ex / AR
End If
b1cnt:
If (R2.Text) = "" Then
GoTo c1cnt
Else
B = R2.Text + 14
BR = R2S.Text
BRS = ex / BR
End If
c1cnt:
If (R3.Text) = "" Then
GoTo d1cnt
Else
C = R3.Text + 20
CR = R3S.Text
CRS = ex / CR
End If
d1cnt:
If (R4.Text) = "" Then
GoTo e1cnt
Else
D = R4.Text + 25
DR = R4S.Text
DRS = ex / DR
End If
e1cnt:
If (R5.Text) = "" Then
GoTo NO1cnt
Else
E = R5.Text + 29
ER = R5S.Text
ERS = ex / ER
End If
NO1cnt:
'level 1
i = 5
z = 0
If (R1.Text) = "" Then GoTo res2
Do While i less than = A
For i = 5 To A
Sheet1.Cells(i, 3).Select
If z less than ex Then
If ActiveCell.Offset(0, z).Value = "" Then
ActiveCell.Offset(0, z).Value = "W"
End If
End If
If ARS + z less than ex Then
If ActiveCell.Offset(0, (ARS + z)).Value = "" Then
ActiveCell.Offset(0, (ARS + z)).Value = "W"
End If
End If
If ARS * 2 + z less than ex Then
If ActiveCell.Offset(0, (ARS * 2) + z).Value = "" Then
ActiveCell.Offset(0, (ARS * 2) + z).Value = "W"
End If
End If
If ARS * 3 + z less than ex Then
If ActiveCell.Offset(0, (ARS * 3) + z).Value = "" Then
ActiveCell.Offset(0, (ARS * 3) + z).Value = "W"
End If
End If
If ARS * 4 + z Less then ex Then
If ActiveCell.Offset(0, (ARS * 4) + z).Value = "" Then
ActiveCell.Offset(0, (ARS * 4) + z).Value = "W"
End If
End If
If ARS * 5 + z Less than ex Then
If ActiveCell.Offset(0, (ARS * 5) + z).Value = "" Then
ActiveCell.Offset(0, (ARS * 5) + z).Value = "W"
End If
End If
'ActiveCell.Offset(0, 30 + z).Select
z = z + 1
Next i
End Sub
repeat this code for each level
For more help visit my website http://www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Excel one-on-one on-line training available. Email me to arrange.
I am able to provide online help on your computer at a reasonable rate.
Check out my next one-hour Excel Webinar
https://www.crowdcast.io/easyexcelans...
Check out Crowdcast for creating your webinars
https://app.linkmink.com/a/crowdcast/83
If you need to buy Office 2019 follow
https://amzn.to/2VX5dv8
Follow me on Facebook
/ easyexcel.answers
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
http://www.youtube.com/timedtext_cs_p...
*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.