Aşağıdaki kodu iki sayfadan veri alacak şekilde düzenleyebilirmiyiz.

Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Aşağıdaki kod ile Bordro sayfasından veri alıyorum. Buna birde "Personel_Bilgi" sayfasıın A ve C sutunlarından veri almak istiyorum. ilgilenen arkadaşlara teşekkürler.




Sub ÖzelKesinti()
Dim Hucre As Range
Set shD = Sheets("bordro")
Set shA = Sheets("ÖzelKesinti")
Y = 7
For Each Hucre In shD.Range("ax11:ax325")
If IsError(Hucre) = True Then: GoTo f1
If Hucre.Value = 0 Or Hucre.Value = "" Then: GoTo f1
shA.Cells(Y, 3) = shD.Cells(Hucre.Row, 4)
shA.Cells(Y, 4) = shD.Cells(Hucre.Row, 5)
shA.Cells(Y, 5) = shD.Cells(Hucre.Row, 60)
shA.Cells(Y, 6) = shD.Cells(Hucre.Row, 61)
shA.Cells(Y, 7) = shD.Cells(Hucre.Row, 71)
shA.Cells(Y, 10) = shD.Cells(Hucre.Row, Hucre.Column)
Y = Y + 1
f1:
Next
Set shD = Nothing
Set shA = Nothing
End Sub
 

Mahmut Kök

Özel Üye
Katılım
14 Temmuz 2006
Mesajlar
878
Excel Vers. ve Dili
Excel 2007 - Türkçe
Aşağıda kodlarla alabilirsiniz. Ancak, verilerin bulunduğu satır, veri alınan diğer sayfadaki satırla aynı mı? Eğer aynı değilse, diğer sayfadan, alınacak verinin satırını da bulmak gerekir. Eğer veriler aynı satırlara denk geliyorsa mesele yok.

Kod:
shA.Cells(Y, 11) = Sheets("Personel_Bilgi").Cells(Hucre.Row, 1)
shA.Cells(Y, 12) = Sheets("Personel_Bilgi").Cells(Hucre.Row, 2)
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Sayın mesleki çok teşekkür ederim. Sütun yerlerini ben kendim ayarladım. ellerine sağlık
 
Üst