Ana içeriğe atla

Excel'de tarih girildiğinde veya değiştirildiğinde tarih otomatik olarak nasıl sıralanır? 

Excel'de Sırala işlevi, tarihi ihtiyaç duyduğunuzda artan veya azalan düzende sıralamanıza yardımcı olabilir. Ancak bu dinamik değildir, eğer tarihi sıraladıysanız ve sonra ona yeni tarih eklediyseniz, tekrar sıralamanız gerekir. Bir çalışma sayfasına her defasında yeni tarih girerken tarihi otomatik olarak sıralamanın iyi ve hızlı yolları var mı?

Formül ile tarih girildiğinde veya değiştirildiğinde otomatik sıralama tarihi

VBA kodu ile tarih girildiğinde veya değiştirildiğinde otomatik sıralama tarihi


ok mavi sağ balon Formül ile tarih girildiğinde veya değiştirildiğinde otomatik sıralama tarihi

Örneğin, Sütun A'daki orijinal tarih, aşağıdaki formül, sıralamak istediğiniz sütuna göre yeni bir yardımcı sütundaki tarihi veya diğer metin dizelerini otomatik olarak sıralamanıza yardımcı olabilir, lütfen aşağıdakileri yapın:

1. Şu formülü girin:

=INDEX($A$2:$A$15,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$15,"<="&$A$2:$A$15),0)) tarih sütununun yanındaki boş bir hücreye, C2örneğin ve ardından Ctrl + Üst Karakter + Enter tuşları bir araya getirin ve bir sayı dizisi elde edersiniz, ardından doldurma tutamacını kullanmak istediğiniz hücrelere sürükleyin, ekran görüntüsüne bakın:

not: Yukarıdaki formülde: A2: A15 otomatik sıralamak istediğiniz orijinal tarih aralığınızdır.

tarihe göre doc otomatik sıralama 1

2. Ardından sayıları tarih biçimi olarak biçimlendirmek için Kısa tarih itibaren genel aşağı açılır liste Ana Sayfa sekmesi, ekran görüntüsüne bakın:

tarihe göre doc otomatik sıralama 2

3. Ardından sıra numaraları tarih formatına dönüştürüldü ve orijinal tarih de sıralandı, ekran görüntüsüne bakın:

tarihe göre doc otomatik sıralama 3

4. Şu andan itibaren, A sütununda yeni tarih girdiğinizde veya tarihi değiştirdiğinizde, C sütunundaki tarih otomatik olarak artan sırada sıralanacaktır, ekran görüntüsüne bakın:

tarihe göre doc otomatik sıralama 4


ok mavi sağ balon VBA kodu ile tarih girildiğinde veya değiştirildiğinde otomatik sıralama tarihi

Aşağıdaki VBA kodu, yeni tarih girdiğinizde veya ihtiyaç duyduğunuzda tarihi değiştirdiğinizde orijinal sütundaki tarihi otomatik olarak sıralamanıza yardımcı olabilir.

1. Bir tarih girdiğinizde veya değiştirdiğinizde tarihi otomatik olarak sıralamak istediğiniz çalışma sayfasına gidin.

2. Sayfa sekmesine sağ tıklayın ve Kodu Görüntüle bağlam menüsünden, açılır pencerede Uygulamalar için Microsoft Visual Basic penceresi, lütfen aşağıdaki kodu boşluğa kopyalayıp yapıştırın modül pencere, ekran görüntüsüne bakın:

VBA kodu: tarih girildiğinde veya değiştirildiğinde otomatik sıralama:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
    On Error Resume Next
    If Application.Intersect(Target, Application.Columns(1)) Is Nothing Then Exit Sub
    If Target.Count > 1 Then Exit Sub
    Range("A1").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _
                                        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

tarihe göre doc otomatik sıralama 6

not: Yukarıdaki kodda, girilen tarih A sütununda otomatik sıralama olacaktır, değiştirebilirsiniz A1 ve A2 ihtiyaç duyduğunuzda kendi hücrelerinize.

3. Şu andan itibaren, A sütununa tarih girdiğinizde, tarih otomatik olarak artan şekilde sıralanacaktır.

En İyi Ofis Üretkenlik Araçları

🤖 Kutools AI Yardımcısı: Aşağıdakilere dayalı olarak veri analizinde devrim yaratın: Akıllı Yürütme   |  Kodunu oluşturun  |  Özel Formüller Oluşturun  |  Verileri Analiz Edin ve Grafikler Oluşturun  |  Kutools İşlevlerini Çağır...
Popüler Özellikler: Yinelenenleri Bul, Vurgula veya Tanımla   |  Boş Satırları Sil   |  Veri Kaybı Olmadan Sütunları veya Hücreleri Birleştirin   |   Formülsüz Tur ...
Süper Arama: Çoklu Ölçütlü VLookup    Çoklu Değer VLookup  |   Birden Çok Sayfada VLookup   |   Bulanık Arama ....
Gelişmiş Açılır Liste: Hızla Açılır Liste Oluşturun   |  Bağımlı Açılır Liste   |  Çoklu Seçim Açılır Liste ....
Sütun Yöneticisi: Belirli Sayıda Sütun Ekleme  |  Sütunları Taşı  |  Gizli Sütunların Görünürlük Durumunu Değiştir  |  Aralıkları ve Sütunları Karşılaştırın ...
Öne Çıkan Özellikler: Izgara Odağı   |  Tasarım görünümü   |   Büyük Formül Çubuğu    Çalışma Kitabı ve Sayfa Yöneticisi   |  Kaynak Kütüphanesi (Otomatik metin)   |  Tarih Seçici   |  Çalışma Sayfalarını Birleştirin   |  Hücreleri Şifrele/Şifresini Çöz    E-postaları Listeye Göre Gönder   |  Süper Filtre   |   Özel Filtre (kalın/italik/üstü çizili filtre...) ...
En İyi 15 Araç Seti12 Metin Tools (Metin ekle, Karakterleri Kaldır, ...)   |   50+ Grafik Türleri (Gantt şeması, ...)   |   40+ Pratik Formüller (Yaşı doğum gününe göre hesapla, ...)   |   19 sokma Tools (QR Kodunu Girin, Yoldan Resim Ekle, ...)   |   12 Dönüştürme Tools (Sayılardan Kelimelere, Para Birimi Dönüştürme, ...)   |   7 Birleştir ve Böl Tools (Gelişmiş Kombine Satırları, Bölünmüş hücreler, ...)   |   ... ve dahası

Kutools for Excel ile Excel Becerilerinizi Güçlendirin ve Daha Önce Hiç Olmadığı Gibi Verimliliği Deneyimleyin. Kutools for Excel, Üretkenliği Artırmak ve Zamandan Tasarruf Etmek için 300'den Fazla Gelişmiş Özellik Sunar.  En Çok İhtiyacınız Olan Özelliği Almak İçin Buraya Tıklayın...

Açıklama


Office Tab, Office'e Sekmeli Arayüz Getirir ve İşinizi Çok Daha Kolay Hale Getirir

  • Word, Excel, PowerPoint'te sekmeli düzenlemeyi ve okumayı etkinleştirin, Publisher, Access, Visio ve Project.
  • Yeni pencereler yerine aynı pencerenin yeni sekmelerinde birden çok belge açın ve oluşturun.
  • Üretkenliğinizi% 50 artırır ve her gün sizin için yüzlerce fare tıklamasını azaltır!
Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello,This is a great tool. thank you. How can i apply this to multiple columns in the same tab? Could i apply it to restart sorting by date in a new cell of the same column? Would i just repaste the VBA code into the same window?
Thank you.
This comment was minimized by the moderator on the site
Hello Noname9,How are you? To achieve your goal by using VBA code is beyond my reach. But I do know how to use formulas to do the trick.Suppose we have two columns of dates, say A2:B7. How to sort these dates into a new column? Please do as follows.
First, we need to combine the two columns of dates into one column. Copy and paste the formula =INDEX($A$2:$B$7,INT((ROWS(D$2:D2)-1)/2)+1,MOD(ROWS(D$2:D2)-1,2)+1) into cell D2. And drag the fill handle down to combine all dates. Please see screenshot 1.
Then, we will sort the combined dates. Copy and paste the formula =INDEX($D$2:$D$13,MATCH(ROWS($D$2:D2),COUNTIF($D$2:$D$13,"<="&$D$2:$D$13),0)) into F2. And drag the fill handle down to sort all dates. Please see screenshot 2.
Hope it will help. Have a nice day.Sincerely,Mandy
This comment was minimized by the moderator on the site
Hello,What if i want to do this to multiple columns or even have anew start point in the same column? Do i just do a break and recopy the VBA code in that same window?
Thank you.
This comment was minimized by the moderator on the site
That VBA code is solid gold! Thank you! :-)
This comment was minimized by the moderator on the site
With the VBA code, I have copy and pasted the above but wish for the dates in column F to be the values by which the data is sorted. I've changed the range values to F2 and F3500 (the size of the spreadsheet where row 1 is titles), but it still sorts by the dates in column A. Can somebody help me please?
This comment was minimized by the moderator on the site
Hello, Ross,
When applying the code to column F, you should change some references to your need as below code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160606
On Error Resume Next
If Application.Intersect(Target, Application.Columns(6)) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
Range("F1").Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Is there a particular formula to keep the cells following the sorted date? It would be nice to organize by date but keep the entire row of information. Any help would be much appreciated.
This comment was minimized by the moderator on the site
I mad a checkbook register and it works but I want to figure out how to make my entry’s to go into date order. Any help would be appreciated. I’m still learning excel.
This comment was minimized by the moderator on the site
In addition to the duplicate dates, is there also a way to include multiple columns of data when it sorts? I need it to include multiple columns and sort them all together with the expiration dates.
This comment was minimized by the moderator on the site
how can I do this same sorting calculation but from newest date to oldest? Currently it is Oldest to Newest. Flipping the < sign isn't enough and beyond that I don't have a strong enough understanding of what it is doing. Also I think what may be happening is excel automatically works top to bottom causing difficulties.
This comment was minimized by the moderator on the site
Hello, Bo,

To auto sort the date from newest to oldest, you just need to change the <= to >= in the above formula as follows:
=INDEX($A$2:$A$15,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$15,">="&$A$2:$A$15),0))
After inserting this formula, please remember to press Ctrl + Shift + Enter keys together to get the correct result.
Please try it.
This comment was minimized by the moderator on the site
What if there is a duplicate date in the list? And I want both numbers to show up.
This comment was minimized by the moderator on the site
Hello, Ryan,

To sort the date with duplicate ones, you should apply the following formula:

=IFERROR(INDEX($A$2:$A$11,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$11,"<="&$A$2:$A$11),0)),IF(ROWS($A$2:A2)<ROWS($A$2:$A$11),B3,""))

Please remember to press Shift + Ctrl + Enter keys together.

Hope it can help you, thank you!
This comment was minimized by the moderator on the site
Awesome :) Working fine
This comment was minimized by the moderator on the site
U forgot to mention the formula is array and you need to ctrl+Shift+ enter. Luckily you had a screenshot or your page would be a waste of cyberspace
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations