PDA

View Full Version : [SOLVED:] VBA code Function to check if date is weekday



Pamella
08-19-2019, 06:23 PM
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

snb
08-20-2019, 12:53 AM
I think you should do this assignment yourself.

Pamella
08-20-2019, 01:07 AM
I used a filter to help do this