I need help to work out code for the following , not an Excel formula.

In Column A there is a list of dates.
1) Code should start by going to the last used row
2) Check if it is the Date is neither current date or previous - msgbox "there is an error, pls check file" Exit sub
3) Check if last used row col A cell is the current date- if YES- search upwards to find Previous date.

Previous date cannot be a Saturday or Sunday or Public holiday (I can add a list in a separate workbook)

4) Check if last used row col A cell is previous date Then... continue code.

Assign the value to a variable