Excel Vba Forum - Excelce.Net
SORU ve CEVAPLAR (Yazılabilir) => Microsoft Excel, Vba, Makro, Formül vb. Soruları => Çözülen Excel, Vba, Makro, Formül vb. Soruları => Konuyu başlatan: drejan62 - 12 Nisan 2010, 09:09:47
-
Merhabalar,
Ektede görüleceği üzere R sütununda Tarihve saat bulunmakta,
Benim amacım gireceğim saatlerin dışındaki verileri Sayfa2 ye aktarsın.
Örneğim saat 09:000 öncebi ve 17:45 sonrasi işlemleri listelemesini istiyorum.
Tabi örnek saateve bir gün eçen ama normalde verilerim bir aylık.
Teşekkürler
[Forum yazılım güncelleme esnasında sorun oluştuğundan eklendi silinmiştir.]
-
Dosyanız ektedir. 8)
Private Sub CommandButton1_Click()
Dim i As Long, sat1 As Long, sat2 As Long, s2 As Worksheet
Dim saat1 As Date, saat2 As Date
Sheets("Sayfa1").Select
Set s2 = Sheets("Sayfa2")
Application.ScreenUpdating = False
s2.Range("A2:R65536").ClearContents
sat1 = Cells(65536, "R").End(xlUp).Row
sat2 = 2
saat1 = TimeSerial(Hour(TextBox1.Text), Minute(TextBox1.Text), Second(TextBox1.Text))
saat2 = TimeSerial(Hour(TextBox2.Text), Minute(TextBox2.Text), Second(TextBox2.Text))
For i = 2 To sat1
If TimeSerial(Hour(Cells(i, "R").Value), Minute(Cells(i, "R").Value), _
Second(Cells(i, "R").Value)) < saat1 Or TimeSerial(Hour(Cells(i, "R").Value), _
Minute(Cells(i, "R").Value), Second(Cells(i, "R").Value)) > saat2 Then
s2.Range("A" & sat2 & ":R" & sat2).Value = Range("A" & i & ":R" & i).Value
sat2 = sat2 + 1
End If
Next
s2.Select
Application.ScreenUpdating = True
Unload Me
MsgBox "İşlem tamamdır." & vbLf & _
"evrengizlen@hotmail.com", vbOKOnly + vbInformation, "E V R E N"
End Sub
[Forum yazılım güncelleme esnasında sorun oluştuğundan eklendi silinmiştir.]
-
Çok Teşekkürler Üstad.
-
Çok Teşekkürler Üstad.
Rica ederim.
İyi çalışmalar. 8)