I'm attempting to find out how to multiply the number of working hours by the number of days in a month, such as every Monday through Saturday or Tuesday through Sunday. What the user chooses to enter the cell relies on them. The CALCULATION, however, is based on the date that the user inputs in a textbox or cell.
If UCase(val) Like "*TO*" Then
Dim numStringTo As Integer
Dim strToDays() As String
Dim wordToCount As Long
numStringTo = 3
strToDays = VBA.Split(val, " ")
wordToCount = UBound(strToDays)
whEveryDay = ThisWorkbook.Sheets("Input").Cells(X, 4).Value
whEveryDay = whEveryDay * Weekday(nb_days, 6)
Debug.Print "Every = " & whEveryDay
End If
I need to get the total of days in a month and multiply by working hours. As of now we are in January 2023 and the pattern for January is 2-7,9-14,16-21,23-28,30-31 and the patter for November 2022 is 1-5,8-12,15-19,22-26,29-30.
For example:
Days |
Date |
Working Hours |
every Monday to Saturday |
2-7,9-14,16-21,23-28,30-31 |
1.2 |
every Tuesday to Saturday |
1-5,8-12,15-19,22-26,29-30 |
0.5 |
Example of calculation:
Days * Working hours
And I need the computation to be dynamic, so for instance, the number of days in a month will change if I change the cell from "every Monday to Saturday" to "every Wednesday to Monday."