Hi Agnihotri,
I can reproduce the issue on my side. datagridview.rows(
datagridview.rowcount-1 ).cells(0).value is the last row (NewRow with star at the row header). You should use
datagridview.rows(
datagridview.rowcount-2 ).cells(0).value. That is the actually last row.
Hope you can solve the problem. If you have any question, please feel free to tell me.
Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the
All-In-One Code Framework!