Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/05/2011, 13:35
guillebomtrasmiti
 
Fecha de Ingreso: noviembre-2010
Ubicación: madrid
Mensajes: 478
Antigüedad: 13 años, 6 meses
Puntos: 5
Respuesta: suma la cantidad solo 1º celda

Dim total As Decimal = 0
Dim valor As Decimal = 0
Dim text As String
text = CStr(CInt(TxtPorcentaje.Text))
For i As Integer = 0 To DgTotales.Rows.Count - 1 Step 1
valor = CDec(DgTotales.Rows(i).Cells(2).Value)
'MessageBox.Show(CStr(DgTotales.Rows(i).Cells(2).V alue))
'For Each row As DataGridViewRow In DgTotales.Rows
' If row.Cells(2).Value IsNot Nothing Then
If valor <> 0 Then
total = CDec((valor) / CDbl(text) * 100)
'MessageBox.Show(CStr(total))
'valor = (valor * text) / 100
MessageBox.Show(CStr(total))
End If
Next


este es el código que os comenté antes