- Katılım
- 8 Haziran 2007
- Mesajlar
- 761
- Excel Vers. ve Dili
- excel- 2003 Türkçe
Arkadaşlar kolay gelsin. Daha önce aşağıdaki kodu siz değerli arkadaşlara yaptırmıştım. Formda böyle bir örnekler olsada ben bire bir uyarlayamıyorum. Kusura bakmayın.
şimdi iki tarih arasında ver süzmek istiyorum. uyarlayabilirseniz sevinirim. tarihleri aynı yerden alacak
Sheets("Baslama_Tarihi").Range("B2:F250").ClearContents
Dim s1 As Worksheet, s2 As Worksheet, sat As Long, sat2 As Long
Dim hcr As Range
If ComboBox1.Value = "" Then Exit Sub
Set s1 = Sheets("DATA")
Set s2 = Sheets("Baslama_Tarihi")
sat = s1.Cells(65536, "B").End(xlUp).Row
sat2 = s2.Cells(65536, "B").End(xlUp).Row + 1
For Each hcr In s1.Range("E2:E" & sat)
If hcr.Value = CDate(ComboBox1.Value) Then
s2.Range("B" & sat2) = sat2 - 1
s2.Range("B" & sat2 & ":F" & sat2).Value = s1.Range("B" & hcr.Row & ":F" & hcr.Row).Value
sat2 = sat2 + 1
End If
Next
Dim i As Long, Son As Long
Application.ScreenUpdating = False
On Error Resume Next
Son = [B65536].End(3).Row
For i = 2 To Son
Cells(i, "G") = Split(Cells(i, "C"), ".")(1) & _
Application.Rept("a", Split(Cells(i, "L"), ".")(0))
Next i
Range("B2:G" & Son).Sort Range("G2"), xlAscending
Range("G2:G" & Son).ClearContents
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
Private Sub UserForm_Initialize()
Set s1 = Sheets("DATA")
For a = 2 To s1.[E65535].End(3).Row
V = 0
mah = Trim(s1.Cells(a, "E"))
For b = 0 To ComboBox1.ListCount - 1
If ComboBox1.List(b) = mah Then
V = 1
GoTo atla
End If
Next
atla:
If V <> 1 Then
ComboBox1.AddItem mah
End If
V = 0
Next
End Sub
şimdi iki tarih arasında ver süzmek istiyorum. uyarlayabilirseniz sevinirim. tarihleri aynı yerden alacak
Sheets("Baslama_Tarihi").Range("B2:F250").ClearContents
Dim s1 As Worksheet, s2 As Worksheet, sat As Long, sat2 As Long
Dim hcr As Range
If ComboBox1.Value = "" Then Exit Sub
Set s1 = Sheets("DATA")
Set s2 = Sheets("Baslama_Tarihi")
sat = s1.Cells(65536, "B").End(xlUp).Row
sat2 = s2.Cells(65536, "B").End(xlUp).Row + 1
For Each hcr In s1.Range("E2:E" & sat)
If hcr.Value = CDate(ComboBox1.Value) Then
s2.Range("B" & sat2) = sat2 - 1
s2.Range("B" & sat2 & ":F" & sat2).Value = s1.Range("B" & hcr.Row & ":F" & hcr.Row).Value
sat2 = sat2 + 1
End If
Next
Dim i As Long, Son As Long
Application.ScreenUpdating = False
On Error Resume Next
Son = [B65536].End(3).Row
For i = 2 To Son
Cells(i, "G") = Split(Cells(i, "C"), ".")(1) & _
Application.Rept("a", Split(Cells(i, "L"), ".")(0))
Next i
Range("B2:G" & Son).Sort Range("G2"), xlAscending
Range("G2:G" & Son).ClearContents
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
Private Sub UserForm_Initialize()
Set s1 = Sheets("DATA")
For a = 2 To s1.[E65535].End(3).Row
V = 0
mah = Trim(s1.Cells(a, "E"))
For b = 0 To ComboBox1.ListCount - 1
If ComboBox1.List(b) = mah Then
V = 1
GoTo atla
End If
Next
atla:
If V <> 1 Then
ComboBox1.AddItem mah
End If
V = 0
Next
End Sub
