Consulting

Results 1 to 3 of 3

Thread: VBA code Function to check if date is weekday

  1. #1
    VBAX Regular
    Joined
    Jul 2019
    Posts
    36
    Location

    VBA code Function to check if date is weekday

    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

  2. #2
    Knowledge Base Approver VBAX Guru
    Joined
    Apr 2012
    Posts
    4,522
    I think you should do this assignment yourself.

  3. #3
    VBAX Regular
    Joined
    Jul 2019
    Posts
    36
    Location
    I used a filter to help do this

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •