Copy rows with date criteria

  • Hello everybody,
    My question relates to this nice code from ozzgridmember "Thomach"
    I'am trying to modify the code so the criteria is based on a month value instead of a string.
    So y changed the variable MyWeek in MyMonth like this

    Code
    Dim MyMonth As Integer
    MyMonth = Month(Range("A7").Value) 'Month returns 1


    But it is not working,what am y doing wrong?


    RichNL
    Thanks in advance

  • Re: Copy rows with date criteria


    Hi RichNL,


    Which line is showing error.


    Try using Msgbox code after your new line of code to test whether the line of code is working.


    HTH.

  • Re: Copy rows with date criteria


    Thanks for your reply,


    It is exactly how y put it


    Y changed the variable so the rows that need to be copied should match with any off the dates containing january .
    Somehow the code will not work it just skips the statements that need to copy the row.


    Is there something wrong with my syntax? What am y missing here


    RichNL

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!