I need a faster way of going from row 1 to 1000 without writing every row or colunm 1000 times.
Do I need to declare it?
Dim .... as integer ?
I need to save memory. Please help
	
							
						
					Do I need to declare it?
Dim .... as integer ?
I need to save memory. Please help
Code:
	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = 5 Then
            '*NOTE:*Cell  Cell 0 + Cell 1 + Cell 2 and so on til  Cell 20
            DataGridView1(0, 0).Value = 1
            DataGridView1(0, 1).Value = 1
            DataGridView1(0, 2).Value = 1
            '*NOTE:*Row 1+2+3 and so on till 1000
            DataGridView1(1, 0).Value = 1
            DataGridView1(2, 1).Value = 1
            DataGridView1(3, 2).Value = 1
            '*NOTE:*Sum Rows 0, Cell 0 + Cell 1 + Cell 2 and so on til  Cell 20
            TextBox2.Text = DataGridView1(0, 0).Value + DataGridView1(0, 1).Value + DataGridView1(0, 2).Value  'and so on till 20
            '*NOTE:*Sum Row 0 + Row 1 + Row 2 and so on till 1000
            TextBox3.Text = DataGridView1(0, 0).Value + DataGridView1(1, 0).Value + DataGridView1(2, 0).Value 'and so on till Row 1000
        End If
    End Sub
Comment