I have used a UDF in my register system as shown below, and it works well.
However, I need it to ignore the characters 'O' (Thats the letter O by the way), and the character "W" if entered in a Row, and if either are entered the original date is left unchanged. In other words, the true last date of attendance is not changed if the O or the W is entered.
Function DateofLastAttendance(mDates, mTimes As Range)
Dim mCol As Integer
For Each cell In mTimes
If cell.Value <> vbNullString Then
mCol = cell.Column
End If
Next cell
DateofLastAttendance = Cells(mDates.Row, mCol)
End Function
I have tried so many ways to implement this I have become confused, and any help would be much appreciated.
Looking forward to any reply that can guide me as to how to achieve this.
Regards
However, I need it to ignore the characters 'O' (Thats the letter O by the way), and the character "W" if entered in a Row, and if either are entered the original date is left unchanged. In other words, the true last date of attendance is not changed if the O or the W is entered.
Function DateofLastAttendance(mDates, mTimes As Range)
Dim mCol As Integer
For Each cell In mTimes
If cell.Value <> vbNullString Then
mCol = cell.Column
End If
Next cell
DateofLastAttendance = Cells(mDates.Row, mCol)
End Function
I have tried so many ways to implement this I have become confused, and any help would be much appreciated.
Looking forward to any reply that can guide me as to how to achieve this.
Regards