VBA to set dynamic formula

  • 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.

  • Re: VBA to set dynamic formula


    Hi skamat,


    Please note my change (this time) to your old title of just "VBA" to something more internet search friendly. Please make sure the title of your future posts adhere to this.


    With regard to your query - as long as there's some data in the "data" tab the following will work:



    Regards,


    Robert

  • Re: VBA to set dynamic formula


    Dear Sir


    Not working perfectly fine.
    Below is the full VBA that I have written



Participate now!

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