Jump to content

Vba Döngüde Hata Alıyorum


felischaus
 Share

Recommended Posts

İyi günler arkadaşlar, benim sorunum şu ki VBA'da bir datagridview nesnesi üzerinde x sütunundaki elemanların karesini toplatmak istiyorum fakat ilk satırı bir türlü toplamıyor, toplamaya ikinci satırdan başlıyor; uyguladığım kod ve proje dosyası şöyle;

 

 

Public Class Form1

    Dim hata1, xkaretoplam As VariantType
    Private Sub DataGridView1_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
        n.Text = Val(DataGridView1.RowCount) - 1
        xkare.Text = 0
        For i = 1 To Val(DataGridView1.RowCount) - 1
            xkaretoplam = Val(DataGridView1.Rows(i).Cells("X").Value()) ^ 2
            xkare.Text = xkaretoplam + Val(xkare.Text)
        Next
    End Sub
End Class

 

proje dosyası;

http://rapidshare.com/share/DC020A44B9B3187819636FC0D489C4FC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...