• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to drag formula on basis of source cell.

Sanoj

Member
Hello Guys,
I am working on a macro where we have to use vlookup formula.
Every time the number of row varies.
So at present the formula which I set to dragging down is till C1000. So, if the value is only till B800 rest of the 200 cells the value is #N/A which I need to remove manually.
Is there a way that the formula in C will drop down only till end of source cell that is B.
Example if value in col B is till B250 the macro should drop down the formula in col C till C250 only.
Thanks,
Sanoj
 
Hi,
Something like this.
Range("C2:C" & Cells(Rows.Count, 2).End(xlUp).Row) = "=1+1"
where 1+1 is ur formula.
 
Back
Top