HSAR
Banned - Rules violations
- Joined
- Jul 6, 2020
- Messages
- 37
- Office Version
- 2016
- Platform
- Windows
Using below code and have tried a lot to make some changes in code but could not as have shared in picture.
I want this result from below code
Please help.
I want this result from below code
Please help.
VBA Code:
Sub TextDate()
With Sheets("data")
f = .Cells(.Rows.Count, "F").End(xlUp).Row
If f > 3 Then .Range("F4:H" & f).ClearContents
'Coder Name Range Don't Chnage it
.Range("G3") = .Range("C1")
f = 3
For y = 3 To 33
a = .Cells(y, "A") 'Used for Date format
b = .Cells(y, "C")
c = .Cells(y, "D")
d = .Cells(y, "E") 'Used for Comment section
If b <> Empty And b <> Empty Then
Select Case b
Case "a", "A"
txt = "Absent "
'Case "1", "L"
txt = "Late "
Case Else
txt = "Leave "
End Select
f = f + 1
.Cells(f, "G") = Format(a, "ddd dd-mmm-yyyy") 'Used for Date format
.Cells(f, "H") = txt
.Cells(f, "I") = txt
.Cells(f, "J") = d 'Used for Comment section
End If
Next y
End With
End Sub