- Katılım
- 27 Eylül 2015
- Mesajlar
- 15
- Excel Vers. ve Dili
- İngilizce
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Rapor_Al()
Dim syf(), sat As Long, i As Byte, c As Range, Adr As String
Application.ScreenUpdating = False
Sheets("Rapor").Select
Range("A4:D" & Rows.Count).ClearContents
syf = Array("Data1", "Data2", "Data3")
sat = 4
For i = 0 To UBound(syf)
With Sheets(syf(i))
Set c = .[D:D].Find([A1], , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
.Cells(c.Row, "A").Resize(1, 3).Copy Cells(sat, "A")
Cells(sat, "D") = .Name
sat = sat + 1
Set c = .[D:D].FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End With
Next i
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim syf(), sat As Long, i As Byte, c As Range, Adr As String
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Range("A4:D" & Rows.Count).ClearContents
If Target = "" Then Exit Sub
syf = Array("Data1", "Data2", "Data3")
sat = 4
For i = 0 To UBound(syf)
With Sheets(syf(i))
Set c = .[D:D].Find([A1], , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
.Cells(c.Row, "A").Resize(1, 3).Copy Cells(sat, "A")
Cells(sat, "D") = .Name
sat = sat + 1
Set c = .[D:D].FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End With
Next i
Application.ScreenUpdating = True
End Sub