Mehmet Sait
Altın Üye
- Katılım
- 19 Ekim 2009
- Mesajlar
- 840
- Excel Vers. ve Dili
- Office 2016 TR
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Base 1
Sub durum()
Dim z As Object, sat As Long, i As Long, myarr(), list()
Dim sh As Worksheet, n As Long, deg As String
Sheets("Dağılım").Select
Application.ScreenUpdating = False
Range("Y12:AC" & Rows.Count).ClearContents
Set sh = Sheets("Liste")
sat = sh.Cells(Rows.Count, "D").End(xlUp).Row
If sat < 5 Then
MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I"
Set sh = Nothing
Application.ScreenUpdating = True
Exit Sub
End If
list = sh.Range("D5:G" & sat).Value
Set z = CreateObject("Scripting.dictionary")
ReDim myarr(1 To 5, 1 To UBound(list))
For i = 1 To UBound(list)
deg = list(i, 1) & "-" & list(i, 4)
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = list(i, 1)
End If
If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3)
If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3)
If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3)
If list(i, 4) = "F" Then myarr(5, z.Item(deg)) = myarr(5, z.Item(deg)) + list(i, 3)
Next i
If n > 0 Then
Range("Y12").Resize(n, 5) = Application.Transpose(myarr)
End If
Application.ScreenUpdating = True
Set z = Nothing
Set sh = Nothing
Erase myarr
MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com"
End Sub
Dosyanız ektedir.Sayın Orion1
Öncelikle zahmet ve uğraşınız için teşekkür ederim.
Ayrı ayrı teğilde, ilgili tarihte toplamını alabilirmiyiz acaba?
Mesela 23.08.2011 Borçlar toplamı,Takas toplamı,portföy toplamını
Option Base 1
Sub durum()
Dim z As Object, sat As Long, i As Long, myarr(), list()
Dim sh As Worksheet, n As Long, deg As String
Sheets("Dağılım").Select
Application.ScreenUpdating = False
Range("Y12:AC" & Rows.Count).ClearContents
Set sh = Sheets("Liste")
sat = sh.Cells(Rows.Count, "D").End(xlUp).Row
If sat < 5 Then
MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I"
Set sh = Nothing
Application.ScreenUpdating = True
Exit Sub
End If
list = sh.Range("D5:G" & sat).Value
Set z = CreateObject("Scripting.dictionary")
ReDim myarr(1 To 5, 1 To UBound(list))
For i = 1 To UBound(list)
deg = list(i, 1)
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = list(i, 1)
End If
If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3)
If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3)
If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3)
If list(i, 4) = "F" Then myarr(5, z.Item(deg)) = myarr(5, z.Item(deg)) + list(i, 3)
Next i
If n > 0 Then
Range("Y12").Resize(n, 5) = Application.Transpose(myarr)
End If
Application.ScreenUpdating = True
Set z = Nothing
Set sh = Nothing
Erase myarr
MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com"
End Sub
doayanız ektedir.Sayın Orion1
Hocam listeleme yaparken listedeki sadece D sutunu baz alıyor dolayısıyla tarihlerde işlem olmasada geliyor. G sutunundan B,T,P olanları yanlız aldırabilirmiyiz.
Ben sadece ne kadar verilmiş borç evraklarım var. Takasta ne kadar ve portföyde ne kadar var görmek istiyorum. Takastaki ile Portföyde olanların toplamı borç çeklerimi karşılıyormu analiz etmek istemiştim.
Option Base 1
Sub durum()
Dim z As Object, sat As Long, i As Long, myarr(), list()
Dim sh As Worksheet, n As Long, deg As String
Sheets("Dağılım").Select
Application.ScreenUpdating = False
Range("Y12:AC" & Rows.Count).ClearContents
Set sh = Sheets("Liste")
sat = sh.Cells(Rows.Count, "D").End(xlUp).Row
If sat < 5 Then
MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I"
Set sh = Nothing
Application.ScreenUpdating = True
Exit Sub
End If
list = sh.Range("D5:G" & sat).Value
Set z = CreateObject("Scripting.dictionary")
ReDim myarr(1 To 5, 1 To UBound(list))
For i = 1 To UBound(list)
If list(i, 4) = "B" Or list(i, 4) = "P" Or list(i, 4) = "T" Then
deg = list(i, 1)
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = list(i, 1)
End If
If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3)
If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3)
If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3)
End If
Next i
If n > 0 Then
Range("Y12").Resize(n, 5) = Application.Transpose(myarr)
End If
Application.ScreenUpdating = True
Set z = Nothing
Set sh = Nothing
Erase myarr
MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com"
End Sub
doayanız ektedir.
Kod:Option Base 1 Sub durum() Dim z As Object, sat As Long, i As Long, myarr(), list() Dim sh As Worksheet, n As Long, deg As String Sheets("Dağılım").Select Application.ScreenUpdating = False Range("Y12:AC" & Rows.Count).ClearContents Set sh = Sheets("Liste") sat = sh.Cells(Rows.Count, "D").End(xlUp).Row If sat < 5 Then MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I" Set sh = Nothing Application.ScreenUpdating = True Exit Sub End If list = sh.Range("D5:G" & sat).Value Set z = CreateObject("Scripting.dictionary") ReDim myarr(1 To 5, 1 To UBound(list)) For i = 1 To UBound(list) If list(i, 4) = "B" Or list(i, 4) = "P" Or list(i, 4) = "T" Then deg = list(i, 1) If Not z.exists(deg) Then n = n + 1 z.Add deg, n myarr(1, n) = list(i, 1) End If If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3) If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3) If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3) End If Next i If n > 0 Then Range("Y12").Resize(n, 5) = Application.Transpose(myarr) End If Application.ScreenUpdating = True Set z = Nothing Set sh = Nothing Erase myarr MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com" End Sub
Bunu anlamadım.dosya üzertinde gösterip orada açıklamasını yazrsanız daha anlaşılır olacaktır.Sayın Orion1
Hocam,
Son bir ricam daha olacaktı. Verdiğiniz kodlara hücre boş ise sarı dolgu olması için ne yapmam gerek ? Mesela 28.08.2012 Takasta ,portföyde ve borç kısmında tutar yoksa dolgu sarı olsa iyi olur.
Bunu anlamadım.dosya üzertinde gösterip orada açıklamasını yazrsanız daha anlaşılır olacaktır.![]()
Dosyanız ektedir.Sayın Orion1
Hocam,
Açıklama dosya içerisinde.
Option Base 1
Sub durum()
Dim z As Object, sat As Long, i As Long, myarr(), list()
Dim sh As Worksheet, n As Long, deg As String, hcr As Range
Sheets("Dağılım").Select
Application.ScreenUpdating = False
Range("Y12:AC" & Rows.Count).Clear
Set sh = Sheets("Liste")
sat = sh.Cells(Rows.Count, "D").End(xlUp).Row
If sat < 5 Then
MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I"
Set sh = Nothing
Application.ScreenUpdating = True
Exit Sub
End If
list = sh.Range("D5:G" & sat).Value
Set z = CreateObject("Scripting.dictionary")
ReDim myarr(1 To 5, 1 To UBound(list))
For i = 1 To UBound(list)
If list(i, 4) = "B" Or list(i, 4) = "P" Or list(i, 4) = "T" Then
deg = list(i, 1)
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = list(i, 1)
End If
If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3)
If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3)
If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3)
End If
Next i
If n > 0 Then
Range("Y12").Resize(n, 5) = Application.Transpose(myarr)
End If
Set z = Nothing
Set sh = Nothing
Erase myarr
sat = Cells(Rows.Count, "Y").End(xlUp).Row
If sat < 12 Then Exit Sub
For Each hcr In Range("Z12:AB" & sat)
If hcr.Value = "" Then hcr.Interior.ColorIndex = 15
Next
Application.ScreenUpdating = True
MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com"
End Sub
Dosyanız ektedir.Hocam,
Güzel olmuş eline sağlık ama karakter büyüklüğünü her defasında 8 yapıyorum makroyu çalıştırdığımda karakter büyüklüğü 11 oluyor. Bunu 8 yapabilirmiyiz. Temizle butonuna basıldığında Hücre dolguları temizlenmiyor.
Option Base 1
Sub durum()
Dim z As Object, sat As Long, i As Long, myarr(), list()
Dim sh As Worksheet, n As Long, deg As String, hcr As Range
Sheets("Dağılım").Select
Application.ScreenUpdating = False
Range("Y12:AC" & Rows.Count).Clear
Range("Y12:AC" & Rows.Count).Font.Size = 8
Set sh = Sheets("Liste")
sat = sh.Cells(Rows.Count, "D").End(xlUp).Row
If sat < 5 Then
MsgBox "Listede Veri yok.İşlem İptal Oldu!!", vbCritical, "U Y A R I"
Set sh = Nothing
Application.ScreenUpdating = True
Exit Sub
End If
list = sh.Range("D5:G" & sat).Value
Set z = CreateObject("Scripting.dictionary")
ReDim myarr(1 To 5, 1 To UBound(list))
For i = 1 To UBound(list)
If list(i, 4) = "B" Or list(i, 4) = "P" Or list(i, 4) = "T" Then
deg = list(i, 1)
If Not z.exists(deg) Then
n = n + 1
z.Add deg, n
myarr(1, n) = list(i, 1)
End If
If list(i, 4) = "B" Then myarr(2, z.Item(deg)) = myarr(2, z.Item(deg)) + list(i, 3)
If list(i, 4) = "T" Then myarr(3, z.Item(deg)) = myarr(3, z.Item(deg)) + list(i, 3)
If list(i, 4) = "P" Then myarr(4, z.Item(deg)) = myarr(4, z.Item(deg)) + list(i, 3)
End If
Next i
If n > 0 Then
Range("Y12").Resize(n, 5) = Application.Transpose(myarr)
End If
Set z = Nothing
Set sh = Nothing
Erase myarr
sat = Cells(Rows.Count, "Y").End(xlUp).Row
If sat < 12 Then Exit Sub
For Each hcr In Range("Z12:AB" & sat)
If hcr.Value = "" Then hcr.Interior.ColorIndex = 15
Next
Application.ScreenUpdating = True
MsgBox "İşlem Tamamlanmıştır." & vbLf & "evrengizlen@hotmail.com"
End Sub