hi,
how can i write vba code to retrieve the month from a cell that holds a date

the problem is that i'm doing a comparison. if the month of the date in row i is p and year is q, where p n q are pre-defined, then i want to copy row i to another sheet. however, running the code below returns an error of Type Mismatch. I assigned P and Q to be integers. so how do i go abt resolving this problem? any kind souls pls help

Please Login or Register  to view this content.