• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

vba ile oluşturduğum listeyi tersten listelemek ?

  • Konbuyu başlatan Konbuyu başlatan dimor
  • Başlangıç tarihi Başlangıç tarihi
Katılım
28 Eylül 2010
Mesajlar
7
Excel Vers. ve Dili
2013
Merhaba şöyle bir kod kullanıyorum. Bu kod sayesinde tarihler ilk ten sonra doğru sıralanıyor. Ben en son tarihin en üstte , eskinin en altta olmasını istiyorum. Bu koda nasıl ilave yaparak bunu sağlarım.
Kod:
Option Explicit
Private Sub Workbook_Open()
' hiker95, 07/26/2012
' http://www.mrexcel.com/forum/showthread.php?649576-Extract-unique-values-from-one-column-using-VBA
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Sheets("İHALE").Range("A65536:A1" & lr)
For i = 1 To UBound(c, 1)
  d(c(i, 1)) = 1
Next i
Range("Z7").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
 
Merhaba, şu şekilde deneyiniz:
Kod:
Option Explicit
Private Sub Workbook_Open()
' hiker95, 07/26/2012
' http://www.mrexcel.com/forum/showthread.php?649576-Extract-unique-values-from-one-column-using-VBA
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Sheets("İHALE").Range("A1:A" & lr)
For i = [COLOR="Red"]UBound(c, 1) To 1 Step -1[/COLOR]
  d(c(i, 1)) = 1
Next i
Range("Z7").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
 
Ben oluşan listedeki tarihleri sıralamak istediğinizi algıladım.

Kod:
Private Sub Workbook_Open()
    ' hiker95, 07/26/2012
    ' http://www.mrexcel.com/forum/showthread.php?649576-Extract-unique-values-from-one-column-using-VBA
    Dim d As Object, c As Variant, i As Long, lr As Long
    Set d = CreateObject("Scripting.Dictionary")
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    c = Sheets("İHALE").Range("A1:A" & lr)
    For i = 1 To UBound(c, 1)
        d(CDbl(c(i, 1))) = 1
    Next i
    Range("Z7").Resize(d.Count) = Application.Transpose(d.keys)
    Range("Z7").Sort Range("Z7"), xlDescending, , , , , , xlNo
End Sub
 
Geri
Üst