sum selected cells in a datagridview

Hi Experts

In VB 2005 I have a datagridview and I need to be able to sum selected cells and put the total into a textbox
can anyone help !

Who is Participating?
RamuncikasConnect With a Mentor Commented:
       Dim Total As Long = 0
        For Each Cell As DataGridViewCell In Me.DataGridView1.SelectedCells
            Total += Convert.ToInt64(Cell.Value)
        Me.TextBox1.Text = Total
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.