udentr2002
Altın Üye
- Katılım
- 5 Kasım 2006
- Mesajlar
- 1,503
- Excel Vers. ve Dili
-
iş yerinde Office 365
evde Office 365
- Altın Üyelik Bitiş Tarihi
- 25-12-2029
Merhaba arkadaşlar aşağıdaki kod çalışırken
kodlarının çalışması sırasında Run time error 6 overflow hatası verip aşağıdaki kodu sarı renkte işaretliyor.
bunun sebebi ne olabilir vede nasıl düzeltebilrim?
Kod:
Private Sub CommandButton12_Click()
Dim s1 As Worksheet, sat1 As Long, sat2 As Long, i As Long, k As Range, adr As String
Dim toplam As Double
Sheets("Sarf").Select
Application.ScreenUpdating = False
Range("A3:L65536").ClearContents
Set s1 = Sheets("Rapor")
sat1 = s1.Cells(65536, "B").End(xlUp).Row
sat2 = 3
For i = 3 To sat1
If WorksheetFunction.CountIf(s1.Range("B3:B" & i), s1.Cells(i, "B").Value) = 1 Then
Set k = s1.Range("B3:B" & sat1).Find(s1.Cells(i, "B").Value, , xlValues, xlWhole)
toplam = 0
If Not k Is Nothing Then
adr = k.Address
Do
Range("A" & sat2 & ":L" & sat2).Value = s1.Range("A" & k.Row & ":L" & k.Row).Value
sat2 = sat2 + 1
toplam = toplam + s1.Cells(k.Row, "I").Value
Set k = s1.Range("B3:B" & sat1).FindNext(k)
Loop While Not k Is Nothing And k.Address <> adr
Cells(sat2, "H").Value = "TOPLAM"
Cells(sat2, "I").Value = toplam
sat2 = sat2 + 2
End If
End If
Next i
Application.ScreenUpdating = True
MsgBox "İşlem tamamlanmıştır." & "İbrahim Ö", vbOKOnly + vbInformation, "N"
End Sub
Kod:
Range("A" & sat2 & ":L" & sat2).Value = s1.Range("A" & k.Row & ":L" & k.Row).Value
Son düzenleme: