- Katılım
- 24 Kasım 2007
- Mesajlar
- 769
- Excel Vers. ve Dili
- Office 365 - Türkçe
Merhaba
sonsatir = s2.Range("A65536").End(xlUp).Row
Son dolu satır eğer "A1" hücresi ise o zaman yapıştırma işlemini Row+1 olan "A2" hücresinden değilde "A3" hücresinden başla demem lazım
Aşağıdaki kodu ekledim, çalıştıramadım, nerede hata yapıyorum
if s2.Range("A65536").End(xlUp).Row = s2.Range("A1") Then
son satir = s2.Range("A65536").End(xlUp).Row + 2
else
son satir = s2.Range("A65536").End(xlUp).Row + 1
end if
sonsatir = s2.Range("A65536").End(xlUp).Row
Son dolu satır eğer "A1" hücresi ise o zaman yapıştırma işlemini Row+1 olan "A2" hücresinden değilde "A3" hücresinden başla demem lazım
Aşağıdaki kodu ekledim, çalıştıramadım, nerede hata yapıyorum
if s2.Range("A65536").End(xlUp).Row = s2.Range("A1") Then
son satir = s2.Range("A65536").End(xlUp).Row + 2
else
son satir = s2.Range("A65536").End(xlUp).Row + 1
end if
Kod:
Sub Copy()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set s1 = ThisWorkbook.Worksheets("=")
Set s2 = ThisWorkbook.Worksheets("rapor")
sonsatir = s2.Range("A65536").End(xlUp).Row + 1
For i = 3 To Sheets("=").Cells(Rows.Count, "B").End(xlUp).Row
If Sheets("=").Cells(i, 1).Value <> Sheets("=").Cells(i, 3).Value Then
s2.Cells(sonsatir, 1) = s1.Cells(i, 1)
s2.Cells(sonsatir, 2) = s1.Cells(i, 2)
s2.Cells(sonsatir, 3) = s1.Cells(i, 3)
s2.Cells(sonsatir, 4) = s1.Cells(i, 4)
End If
Next i
End Sub
