- Katılım
- 12 Nisan 2012
- Mesajlar
- 533
- Excel Vers. ve Dili
- Microsoft office professional plus 2019
- Altın Üyelik Bitiş Tarihi
- 18-12-2024
Aşağıdaki kod ile "B" sütunundaki tarih ve "A" sütunundaki isme göre excel sayfasındaki hücreye açıklama ekliyorum.Fakat eklediğim bu kayıtlara ulaşabilmem gerekiyor.Yapmak istediğim Combobobox1''den seçili isme ve Textbox1'den seçili tarihe göre o kişiye ait açıklamayı textbox2'de göstermek.Combobox1'de isimler,Textbox1'de ise tarih var."A" sutununda çok sayıda aynı isim var bu yüzden tarih kriterinide kullanıyorum.Yardımcı olusanız sevinirim.
Dim trh As Date, ara As String, deg As String, c As Range, Adr As String
trh = TextBox1
ara = ComboBox1
deg = TextBox2
If deg = "" Then
MsgBox "Önce Açıklama Girin", vbInformation
Exit Sub
End If
Set c = [A:A].Find(ara, , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
If Cells(c.Row, "B") = trh Then
Cells(c.Row, "A").ClearComments
Cells(c.Row, "A").AddComment
Cells(c.Row, "A").Comment.Text Text:=""
Cells(c.Row, "A").Comment.Text Text:=deg
s = 1
End If
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
If s = 1 Then
MsgBox "Açıklama Eklendi", vbInformation
Else
MsgBox "Veri Bulunamadı", vbInformation
End If
Dim trh As Date, ara As String, deg As String, c As Range, Adr As String
trh = TextBox1
ara = ComboBox1
deg = TextBox2
If deg = "" Then
MsgBox "Önce Açıklama Girin", vbInformation
Exit Sub
End If
Set c = [A:A].Find(ara, , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
If Cells(c.Row, "B") = trh Then
Cells(c.Row, "A").ClearComments
Cells(c.Row, "A").AddComment
Cells(c.Row, "A").Comment.Text Text:=""
Cells(c.Row, "A").Comment.Text Text:=deg
s = 1
End If
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
If s = 1 Then
MsgBox "Açıklama Eklendi", vbInformation
Else
MsgBox "Veri Bulunamadı", vbInformation
End If