Kod hata veriyor.

1903emre34@gmail.com

Altın Üye
Katılım
29 Mayıs 2016
Mesajlar
919
Excel Vers. ve Dili
Microsoft Excel 2013 Türkçe
Altın Üyelik Bitiş Tarihi
06-06-2027
Merhaba,

Kullandığı aşağıdaki kod hata veriyor yardımcı olabilir misiniz

shsonuc.Cells(satir, "I").Value = Abs(shsonuc.Cells(satir, "G").Value - shsonuc.Cells(satir, "H").Value)
 

Ekli dosyalar

YUSUF44

Destek Ekibi
Destek Ekibi
Katılım
4 Ocak 2006
Mesajlar
12,071
Excel Vers. ve Dili
İş : Ofis 365 - Türkçe
Ev: Ofis 365 - Türkçe
Sayfa1'deki sayılarınız hücrede boşluklu olarak yer alıyor ve dolayısıyla sayı değiller. Aşağıdaki gibi dener misiniz?

PHP:
Sub Düğme1_Tıklat()
Application.DisplayAlerts = False
   Set Sh1 = Sheets("Sayfa1")
   If WorksheetExists("Sonuc") Then
      Sheets("Sonuc").Delete
   End If
   Set Newsh = Sheets.Add(After:=Sheets(Sheets.Count))
   Newsh.Name = "Sonuc"
   Set shsonuc = Sheets("Sonuc")
  
   Sh1.Range("A5:I5").Copy shsonuc.Range("A5")
   sonsatir = Sh1.Cells(Rows.Count, "A").End(3).Row
   satir = 5
   For i = 6 To sonsatir
     veri = Sh1.Cells(i, 1).Value
     oncekiveri = Sh1.Cells(i - 1, 2).Value
     If InStr(veri, "Ara toplam") > 0 Then
        satir = satir + 1
        For j = 1 To 9
            shsonuc.Cells(satir, j) = Trim(Sh1.Cells(i, j))
            If j > 4 Then shsonuc.Cells(satir, j) = shsonuc.Cells(satir, j) * 1
        Next
        shsonuc.Range("B" & satir).Value = Left(oncekiveri, 3)
        shsonuc.Cells(satir, "G").Value = shsonuc.Cells(satir, "E").Value + shsonuc.Cells(satir, "G").Value
        shsonuc.Cells(satir, "E").Value = 0
        shsonuc.Cells(satir, "I").Value = Abs(shsonuc.Cells(satir, "G").Value - shsonuc.Cells(satir, "H").Value)
     End If

   Next i
    shsonuc.Cells.Select
    shsonuc.Cells.EntireColumn.AutoFit
    shsonuc.Range("A1").Select
    
Application.DisplayAlerts = True
End Sub
 

1903emre34@gmail.com

Altın Üye
Katılım
29 Mayıs 2016
Mesajlar
919
Excel Vers. ve Dili
Microsoft Excel 2013 Türkçe
Altın Üyelik Bitiş Tarihi
06-06-2027
Teşekkürler, çalıştı.
 
Üst