- Katılım
- 18 Ocak 2008
- Mesajlar
- 12,843
- Excel Vers. ve Dili
-
2003 excell türkçe
ve
2007 excell türkçe
yukarıdaki kodu aşağıdaki ile değiştirinaranan = yer1 & yer2 & yer3 & yer4
aranan = yer2 & yer3 & yer4
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
yukarıdaki kodu aşağıdaki ile değiştirinaranan = yer1 & yer2 & yer3 & yer4
aranan = yer2 & yer3 & yer4
iyi çalışmalaroldu şimdi tşk ederim ufak tefek aynılarından vardı onlarıda elle birleştirdim![]()
Option Explicit
Option Base 1
Sub firamalar_59()
Dim z As Object, yil As String, a(), n As Long, myarr()
Dim sh As Worksheet, fso As Object, f As Object, ds As Object, sat As Long
Dim sat2 As Long, i As Long, deg As String, son_sat As Long
Sheets("Yillik").Select
Range("A2:D65536").ClearContents
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.getfolder(ThisWorkbook.Path).Files
sat = 2
Application.ScreenUpdating = False
For Each ds In f
If ds.Name <> ThisWorkbook.Name Then
If Workbooks.Open(ds).ReadOnly = True Then Workbooks(ds.Name).Close
'Workbooks(ds.Name).Sheets(1).AutoFilter
sat2 = Workbooks(ds.Name).Sheets(1).Cells(65536, "A").End(xlUp).Row
If sat2 > 1 Then
a = Workbooks(ds.Name).Sheets(1).Range("A2:C" & sat2).Value
Workbooks(ds.Name).Close False
Set z = CreateObject("Scripting.Dictionary")
ReDim myarr(1 To 3, 1 To sat2)
For i = 1 To UBound(a, 1)
deg = a(i, 1) & "-" & a(i, 2)
If deg <> "" Then
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = a(i, 1)
myarr(2, n) = a(i, 2)
End If
myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + a(i, 3)
End If
Next i
son_sat = ThisWorkbook.Sheets(1).Cells(65536, "A").End(xlUp).Row + 1
ThisWorkbook.Sheets(1).Range("A" & son_sat).Resize(n, 1) = Left(ds.Name, 4)
ReDim Preserve myarr(1 To 3, 1 To n)
ThisWorkbook.Sheets(1).Range("B" & son_sat).Resize(n, 3) = Application.Transpose(myarr)
Set z = Nothing
n = 0
Erase myarr: Erase a
End If
End If
Next ds
Set fso = Nothing: Set f = Nothing
Application.ScreenUpdating = True
MsgBox "Veriler Yıl - Firma ismi - Marka bazında Ayrışıp Toplandı." & _
vbLf & "evrengizlen@hotmail.com", vbOKOnly + vbInformation, "E V R E N"
End Sub