Userform ve kodlarında değişiklik.

Katılım
31 Ağustos 2005
Mesajlar
1,534
Excel Vers. ve Dili
Excel 2003 - Türkçe
Merhabalar;

Ekte örneğini gönderdiğim çalışmada (Raporlama) iki tarih arası raporlamanın iptal edilerek, sadece seçilen kişiye ait tüm bilgilerin raporlanması ve bunun için kodlarda gerekli değişiklikleri beceremedim.

Açıklama Sayfa.1.de dir.

Şimdiden teşekkürlerimle.
 
Son düzenleme:

hamitcan

Uzman
Uzman
Katılım
1 Temmuz 2004
Mesajlar
7,712
Excel Vers. ve Dili
Excel 2019 Türkçe
Aşağıdaki şekilde deneyin.

Private Sub CommandButton8_Click()
On Error Resume Next
Set s1 = Sheets("rapor")
s1.[a2:g24].Clear 'Contents
Sheets("hesaplar").Select
bastar = DateSerial(Year(ComboBox2), Month(ComboBox2), 1)
bittar = DateSerial(Year(ComboBox3), Month(ComboBox3) + 1, 1) - 1
ad = ComboBox1.Value
For a = 2 To [c65536].End(3).Row
If ad = "HEPSİ" Then GoTo 10
If Cells(a, "c") = ad Then
c = c + 1
For b = 1 To 7
s1.Cells(c + 1, b) = Cells(a, b).Value
Next
End If
GoTo 20
10 If Cells(a, "a") >= bastar And Cells(a, "a") <= bittar Then
c = c + 1
For b = 1 To 7
s1.Cells(c + 1, b) = Cells(a, b).Value
Next
End If
20 Next
If s1.[A3] = 0 Then
MsgBox "UYGUN VERİ BULUNAMADI"
Exit Sub
End If
'-------------------------------------------------------------

'ListBox1.RowSource = "rapor!a2:g" & s1.[a65536].End(3).Row

Dim j As Integer
' j = ListBox1.ListCount
'Debug.Print j
' For i = 0 To j
' ListBox1.List(i, 5) = Format(ListBox1.List(i, 5), "##,00")
' ListBox1.List(i, 6) = Format(ListBox1.List(i, 6), "##,00")
'
' Next i





'ListBox1.Column(5, 0) = Format(ListBox1.Column(5, 0).Value, "##,00")
'ListBox1.Column(6, 0) = Format(ListBox1.Column(6, 0), "#,##0.00")

'Dim a, b As curreny
'For i = 0 To 22

' a = Format(ListBox1.Column(5), "#,##0.00")
' b = Format(ListBox1.Column(6), "#.##0,00")
' ListBox1.Column(5) = a 'Format(ListBox1.List(i, 5), "#.##0,00")
' ListBox1.Column(6) = b 'Format(ListBox1.List(i, 6), "#,##0.00 YTL")
' Next i

'---------------------------------------------------------------------------
'Private Sub UserForm_Initialize()
''Dim myArray
''Dim d As Integer
''
''ListBox1.ColumnWidths = "60;40;90;90;50;60;60"
''ListBox1.ColumnCount = 7
''d = WorksheetFunction.CountA(Range("a:a"))
''ReDim myArray(d, 6)
''ii = 0
''For i = 1 To d
''If Rows(i).Hidden = False Then
''myArray(ii, 0) = Format(Cells(i, 1), "dd.mm.yyyy")
''myArray(ii, 1) = Cells(i, 2)
''myArray(ii, 2) = Cells(i, 3)
''myArray(ii, 3) = Cells(i, 4)
''myArray(ii, 4) = Cells(i, 5)
''myArray(ii, 5) = Format(Cells(i, 6), "##,# YTL")
''myArray(ii, 6) = Format(Cells(i, 7), "##,# YTL")
'''myArray(ii, 7) = Format(Cells(i, 7), "#.###,#")
'''myArray(ii, 8) = Format(Cells(i, 9), "##,#")
'''myArray(ii, 9) = Format(Cells(i, 9), "##,#")
''
''ii = ii + 1
''End If
''Next
''ListBox1.List = myArray
'''End Sub



kenarlıkçiz
ListBox1.RowSource = "rapor!a2:g" & s1.[a65536].End(3).Row


End Sub
 
Katılım
31 Ağustos 2005
Mesajlar
1,534
Excel Vers. ve Dili
Excel 2003 - Türkçe
Sn. Hamitcan;

Herhalde bir yanl&#305;&#351;l&#305;k oldu. Zira, de&#287;i&#351;tirilmesini istedi&#287;im kodlar&#305; aynen yazm&#305;&#351;s&#305;n&#305;z.
 

hamitcan

Uzman
Uzman
Katılım
1 Temmuz 2004
Mesajlar
7,712
Excel Vers. ve Dili
Excel 2019 Türkçe
If Cells(a, "c") = ad And Cells(a, "a") >= bastar And Cells(a, "a") <= bittar Then sat&#305;r&#305;n&#305; ;
If Cells(a, "c") = ad Then &#351;eklinde de&#287;i&#351;tirdim.
Bir de kodun ba&#351;&#305;na;
On Error Resume Next
ekledim.
 
Katılım
31 Ağustos 2005
Mesajlar
1,534
Excel Vers. ve Dili
Excel 2003 - Türkçe
Sn. Hamitcan;

&#199;ok te&#351;ekk&#252;r ediyorum.
 
Üst