try if target.cells.count......
also, not sure if your target.formula should be target.value, or possibly target.value2.

try it and see