Hi, pranayttt,
please note that you should wrap your procedure with code tags if shown here on Excel-Forum (according to Forum Rul #1)
If you work with ActiveCell this will always work for the active sheet, if you use it inside a With-Statement you must make clear where itīs going to be applied (ActiveSheet without dot prior to the range/cell, referenced sheet with dot in front). You may generate the formula for all cells at once instead of creating it for one cell and then filldown:
Ciao,
Holger
Bookmarks