Quote:
Page means sheet
I dont know which line exactly ,because in a sheet there will be 1000 rows to debug and exception behavior is not consistent.
If you are going to learn to develop code, you need to know the terminology and use it correctly.
Excel has Sheets, not Pages: each sheet is made of y Rows of x Columns.
Code has Lines.
So when you are asked "Which line get the error?" it means "which line of the code in the pile you dumped on us does the error occur on?" and you are told pretty explicitly with the error message, and in the debugger it will stop on the erroneous line of code so you can see what is going on.
We don't have access to your data, and it's the data that is showing up the problem in your code - so you need both your code running and the data it is processing to start finding the error, and we can't do that for you.
So, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. If you don't know how to use it then a quick Google for "Visual Studio debugger" should give you the info you need.
Run your app in the debugger, and when the error occurs it will stop - you will see what line is giving the problem, and what specific data is involved. That may be enough for you to get an idea how to fix it, but if it isn't, but a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.
Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!