For i = 0 To DataGridView1.RowCount - 2
This iterates over all rows but last one.
Change this to
For i = 0 To DataGridView1.SelectedRows.Count - 1
and it will only iterate over selected rows.
Then you will have to tweak the code inside your three loops to work on actual selected row:
For k As Integer = 1 To DataGridView1.Columns.Count
DataGridViewRow row = DataGridView1.SelectedRows.Item(i)