DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub düzenle()
Dim YOL As String, KTP As Workbook, S1 As Worksheet, S2 As Worksheet
Dim STR As Long, SAY As Long, STN As Long
Application.ScreenUpdating = False
YOL = ThisWorkbook.Path & "\"
Set S1 = ActiveSheet
Set KTP = Workbooks.Open(YOL & "kapalı dosya.xlsx")
Set S2 = KTP.Sheets("Sayfa1")
For STR = 7 To S1.Cells(Rows.Count, "A").End(xlUp).Row
For SAY = 2 To S2.Cells(Rows.Count, "A").End(xlUp).Row
If S2.Cells(SAY, "B") = S1.Cells(STR, "B") Then
For STN = 1 To S1.Cells(6, Columns.Count).End(xlToLeft).Column
If S1.Cells(STR, STN) <> "" Then
S2.Cells(SAY, STN) = S1.Cells(STR, STN)
End If: Next
End If: Next: Next
KTP.Save
KTP.Close
Application.ScreenUpdating = True
End Sub
1 satırı güncelleyince bütün satırları aynı güncelleme yapıyor olmuyor yani
Alış tutarları ve kilo da olabilir onlar hep değişik veya en sona sıra no diye sütünda ekleyebiliriz
Option Explicit
Private Sub Image1_Click()
Dim YOL As String, KTP As Workbook, S1 As Worksheet, S2 As Worksheet
Dim STR As Long, SBT As Variant
Application.ScreenUpdating = False
YOL = ThisWorkbook.Path & "\"
Set S1 = ActiveSheet
SBT = ActiveCell.Address
S1.Range("A7:X" & Rows.Count).ClearContents
Set KTP = Workbooks.Open(YOL & "kapalı dosya.xlsx")
Set S2 = KTP.Sheets("Sayfa1")
STR = S2.Range("A" & Rows.Count).End(xlUp).Row
S2.Range("A1:X" & STR).AutoFilter 3, ">=" & S1.Range("A4"), xlAnd, "<=" & S1.Range("B4")
If WorksheetFunction.Subtotal(3, S2.Range("A2:A" & STR)) > 0 Then
S2.Range("A2:X" & STR).Copy: S1.Range("A7").PasteSpecial
End If
S2.Range("A1:X" & STR).AutoFilter
KTP.Close 0
Range(SBT).Select
Application.ScreenUpdating = True
End Sub
Option Explicit
Sub düzenle()
Dim YOL As String, KTP As Workbook, S1 As Worksheet, S2 As Worksheet
Dim STR As Long, SAY As Long, STN As Long, STR1 As Long
Application.ScreenUpdating = False
YOL = ThisWorkbook.Path & "\"
Set S1 = ActiveSheet
Set KTP = Workbooks.Open(YOL & "kapalı dosya.xlsx")
Set S2 = KTP.Sheets("Sayfa1")
For STR = 7 To S1.Cells(Rows.Count, "A").End(xlUp).Row
For SAY = 2 To S2.Cells(Rows.Count, "A").End(xlUp).Row
If WorksheetFunction.CountIf(S2.Range("C:C"), S1.Cells(STR, "C")) > 0 Then
If S2.Cells(SAY, "C") = S1.Cells(STR, "C") And _
S2.Cells(SAY, "A") = S1.Cells(STR, "A") Then
For STN = 1 To S1.Cells(6, Columns.Count).End(xlToLeft).Column
If S1.Cells(STR, STN) <> "" Then
S2.Cells(SAY, STN) = S1.Cells(STR, STN)
End If: Next: End If
Else
STR1 = S2.Range("A" & Rows.Count).End(xlUp).Row + 1
For STN = 1 To S1.Cells(6, Columns.Count).End(xlToLeft).Column
If S1.Cells(STR, STN) <> "" Then
S2.Cells(STR1, STN) = S1.Cells(STR, STN)
End If: Next
End If
Next: Next
KTP.Save
KTP.Close
Application.ScreenUpdating = True
End Sub