skeeeter56
New Member
- Joined
- Nov 26, 2016
- Messages
- 42
- Office Version
-
- 2019
- Platform
-
- Windows
Using the Microsoft template for Employee Attendance Tracker I have created and and modified it with help form users on here. I have the data added to a table on a sheet from a user form.this all works as I want.
The issue is that on the main sheet that data in the table is used to produce a visual calendar of the year. It colors each day depending on the dates enter and type of leave taken. Originally you entered data into the table directly your selection was done via data validation.
When you enter the data in by selecting the cell in the table from the data validation list it all works. But when it is added via the user form it indeed adds it to bottom of table. But for some reason this is not then displayed on other sheet with the calendar.
I am hoping someone can figure out why and assist me with this.
This is the code that adds to the table form the user form this does work and it adds to bottom of table.
https://www.dropbox.com/s/dtcn53hrmral27b/testingappluad.xlsm?dl=0
I hope someone is able to assist me with this.
The issue is that on the main sheet that data in the table is used to produce a visual calendar of the year. It colors each day depending on the dates enter and type of leave taken. Originally you entered data into the table directly your selection was done via data validation.
When you enter the data in by selecting the cell in the table from the data validation list it all works. But when it is added via the user form it indeed adds it to bottom of table. But for some reason this is not then displayed on other sheet with the calendar.
I am hoping someone can figure out why and assist me with this.
This is the code that adds to the table form the user form this does work and it adds to bottom of table.
Code:
Private Sub bOkay_Click()
Dim tbl As ListObject
Dim ws As Worksheet
Dim lrow As Range
Dim lrow2 As Long
Set tbl = Sheets("Employee Leave Tracker").ListObjects("tblLeave")
If tbl.ListRows.Count > 0 Then
Set lrow = tbl.ListRows(tbl.ListRows.Count).Range
For col = 1 To lrow.Columns.Count
If Trim(CStr(lrow.Cells(1, col).Value)) <> "" Then
tbl.ListRows.Add
Exit For
End If
Next
End If
lrow2 = tbl.ListRows.Count
tbl.DataBodyRange(lrow2, 1).Value = cboEmployee.Value
tbl.DataBodyRange(lrow2, 2).Value = sDate.Value
tbl.DataBodyRange(lrow2, 3).Value = eDate.Value
tbl.DataBodyRange(lrow2, 4).Value = cboType.Value
Unload Me
EmployeeLeave.Show
End Sub
https://www.dropbox.com/s/dtcn53hrmral27b/testingappluad.xlsm?dl=0
I hope someone is able to assist me with this.
Last edited: