Find last row and coloumn in excel sheet

Hi Pravin,
This is my scenario i need to get the count from cell A till the value XYZ is present.the starting of the cell is static but the ending cell is dynamic.I am able to get the range.But when i am using counter along with data row(which am using to store the read value) it is not picking up the empty values.i want the count from cell A till the value “XYZ” is present.can you give me an example for this scenario.Here the count is 32