Reputation: 11
I have an Excel Table with several rows of data that get submitted by employees.
One of the columns that I have is for the Day of the week which the employee has to enter. In order for the other half of the system to work properly, I require a submission for each day of the week. I already have the code to add a new row if there are submissions missing.
I am hoping someone can help me with a way to check what days haven't be submitted for each employee, and add it to the column.
Set nRow = A.ListRows.Add
With nRow
.Range(1) = "Name"
.Range(2) = ""
.Range(3) = "Date"
.Range(4) = ""
.Range(5) = ""
.Range(6) = ""
.Range(7) = ""
.Range(8) = ""
.Range(9) = ""
.Range(10) = ""
.Range(11) = "N"
.Range(12) = "Y"
.Range(13) = "Day Of Week goes here"
.Range(14) = ""
.Range(15) = ""
.Range(16) = ""
End With
Upvotes: 1
Views: 67
Reputation: 13024
Format(date,"dddd")
will return todays day of week - e.g. "Tuesday" for 3.5.2022.
Format(date, "ddd")
will return the abbreviation.
The name itself depends on the current language settings.
If you want to use a different date than today just replace 'date' with your date-variable.
Upvotes: 1