Hi all,

I was hoping for some help on this code. I have got a userform that is used to book and delete holidays into an excel spreadsheet. This is working brilliantly now thanks to a lot of help from a number of different people.

I wanted to add in a safety net somehow. So when I want to book dates, the code checks to see if there is a matching entry based on a persons name, the holiday dates (from and to) and the absence reason (ie holiday, sickness, etc).

I'm a little bit stumped as to how to do this, would appreciate any advice?

Dim emptyRow As Long

'Make Absence log Active
Sheets("Absence log").Activate

'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 2

'Export Data to worksheet

Cells(emptyRow, 1).Value = EmployeeName
Cells(emptyRow, 2).Value = CDate(Me.DateFrom)
Cells(emptyRow, 3).Value = CDate(DateTo)
Cells(emptyRow, 4).Value = absencereason
Cells(emptyRow, 5).Value = Staff_Agency
Cells(emptyRow, 6).Value = SAPNumber
Cells(emptyRow, 7).Value = Add_information

Thanks Glynn