You do not need to declare your temporary variables as an array - replace:
Dim qty(100) As Double
Dim price(100) As Double
Dim total(100) As Double
with
Dim qty As Double
Dim price As Double
Dim total As Double
and assign the variables each time you go round the loop:-
itemcode = DataGridView1.Rows(i).Cells(0).Value
price = DataGridView1.Rows(i).Cells(2).Value
qty = DataGridView1.Rows(i).Cells(1).Value
total = DataGridView1.Rows(i).Cells(3).Value
Also - don't use MsgBox for debugging - use System.Diagnostics.Debug.Print and breakpoint on that row.