- Katılım
- 1 Ağustos 2019
- Mesajlar
- 839
- Excel Vers. ve Dili
- Türkçe excel 2016
İngilizce excel 2016
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
s1.[B2].Resize(UBound(b), UBound(b, 2)) = w
s1.Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(UBound(b), UBound(b, 2)) = w
Tam öyle değil hocam TC kimlik numarasına göre tarama yapıp veri sayfasında hangi bilgileri yazdiysam ana sayfada karşılığını bulup ilgili sutuna aktaracakveri'de olup ana sayfa'da olmayan verileri ana sayfa'da B sütunundan en alta eklemek istirorsunuz anladığım kadarı ile
kodun sonudaki
Kod:s1.[B2].Resize(UBound(b), UBound(b, 2)) = w
ifadesini aşağıdaki şekilde değiştirerek deneyin:
Kod:s1.Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(UBound(b), UBound(b, 2)) = w
Sub xlTR_182944()
'https://www.excel.web.tr/threads/kodun-veri-aktarirken-mevcut-diger-verileri-silmesi.182944/
Dim i As Long, j As Long, tm As Double
Dim arrVeri, arrAna
tm = Timer
With Worksheets("VERİ")
arrVeri = .Range("A2:H" & .Cells(.Rows.Count, 1).End(xlUp).Row).Value
End With
With Worksheets("ANA SAYFA")
arrAna = .Range("B2:Z" & .Cells(.Rows.Count, 3).End(xlUp).Row).Value
End With
For i = 1 To UBound(arrVeri)
For j = 1 To UBound(arrAna)
If arrVeri(i, 1) = arrAna(j, 2) Then
If arrAna(j, 23) = "Etkin" Then
arrAna(j, 4) = arrVeri(i, 3)
arrAna(j, 8) = arrVeri(i, 4)
arrAna(j, 20) = arrVeri(i, 5)
arrAna(j, 25) = arrVeri(i, 6)
arrAna(j, 12) = arrVeri(i, 7)
arrAna(j, 14) = arrVeri(i, 8)
End If
End If
Next j
Next i
Worksheets("ANA SAYFA").Range("B2").Resize(UBound(arrAna), UBound(arrAna, 2)).Value = arrAna
MsgBox "İşlem " & (Timer - tm) & " saniyede tamamlandı.", vbInformation
End Sub
Sub xlTR_182944()
'https://www.excel.web.tr/threads/kodun-veri-aktarirken-mevcut-diger-verileri-silmesi.182944/
Dim i As Long, j As Long, tm As Double
Dim arrVeri, arrAna
tm = Timer
With Worksheets("VERİ")
arrVeri = .Range("A2:H" & .Cells(.Rows.Count, 1).End(xlUp).Row).Value
End With
With Worksheets("ANA SAYFA")
arrAna = .Range("B2:Z" & .Cells(.Rows.Count, 3).End(xlUp).Row).Value
End With
For i = 1 To UBound(arrVeri)
For j = 1 To UBound(arrAna)
If arrVeri(i, 1) = arrAna(j, 2) Then
If arrAna(j, 23) = "Etkin" Then
If Not IsEmpty(arrVeri(i, 3)) Then arrAna(j, 4) = arrVeri(i, 3)
If Not IsEmpty(arrVeri(i, 4)) Then arrAna(j, 8) = arrVeri(i, 4)
If Not IsEmpty(arrVeri(i, 5)) Then arrAna(j, 20) = arrVeri(i, 5)
If Not IsEmpty(arrVeri(i, 6)) Then arrAna(j, 25) = arrVeri(i, 6)
If Not IsEmpty(arrVeri(i, 7)) Then arrAna(j, 12) = arrVeri(i, 7)
If Not IsEmpty(arrVeri(i, 8)) Then arrAna(j, 14) = arrVeri(i, 8)
End If
End If
Next j
Next i
Worksheets("ANA SAYFA").Range("B2").Resize(UBound(arrAna), UBound(arrAna, 2)).Value = arrAna
MsgBox "İşlem " & (Timer - tm) & " saniyede tamamlandı.", vbInformation
End Sub