I had requested for a formula earlier for which I got the perfect reply and the solution worked very well.
Now I seek further assistance for VBA. The formula I have entered in VBA is as follows
"=SUMPRODUCT(--(data!R5C1:R100C1=RC3)*--(MONTH(data!R5C2:R100C2)=MONTH(R5C)))"
Now the thing is that it will search only till line 100.
I want it to search till the end of the line, for eg. if the data is till 50 then it should search till 50, if the data is till 500 then it should search till 500.
Again I repeat the above formula is to be used in VBA.