Consulting

Results 1 to 4 of 4

Thread: Check Month and Day

  1. #1

    Check Month and Day

    Not sure how to write this piece for a macro properly -

    If sheets("Actual").range("e2") = current month & system day is > 7 then
    sheets("Actual").range("g2")  = sheets("Data").range("J1")
    end if
    Thanks,

    Kurt

  2. #2
    I'm not clear on what you are comparing. Are you trying to detect if the current day of the current month is greater than 7? If so, then you can use the "Day" function like:
    If Day(Date) > 7 ...

  3. #3
    Cyberdude -

    I want to check to see if the cell = current month and that the system day > 7

    Today is 5/12/05

    Current month is May: E2 = May and system day is 12 which is greater than 7 so the if statement is true.

    Thanks,


    E2= 5/1/05
    I want to verify e2 = current month (May) which it does and today is greater than the 7th day of the month.

    Kurt

  4. #4
    I've got it



    If Day(Date) > 7 And Month(Range("E2")) = Month(Date) Then
    Range("G2") = Sheets("Data").Range("J1")
    End If

Posting Permissions

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