- Katılım
- 8 Haziran 2007
- Mesajlar
- 761
- Excel Vers. ve Dili
- excel- 2003 Türkçe
Hayırlı geçeler. Arkadaşlar tahminimce aşağıdaki kodlarda F sutunundan ve E sutunundan verileri süzüyor. Ben sadece F sununundaki tarihleri süzmesini istiyorum. bir yardımcı olursanız sevinirim. kolay gelsin
Private Sub CommandButton1_Click()
Sheets("RAPOR").Range("B2:F100").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("RAPOR")
sat = s1.Cells(65536, "B").End(xlUp).Row
sat2 = s2.Cells(65536, "B").End(xlUp).Row + 1
For Each hcr In s1.Range("B2:F" & 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
Rows("2:100").Select
Selection.Sort Key1:=Range("D2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
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, "F"))
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
Private Sub CommandButton1_Click()
Sheets("RAPOR").Range("B2:F100").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("RAPOR")
sat = s1.Cells(65536, "B").End(xlUp).Row
sat2 = s2.Cells(65536, "B").End(xlUp).Row + 1
For Each hcr In s1.Range("B2:F" & 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
Rows("2:100").Select
Selection.Sort Key1:=Range("D2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
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, "F"))
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
