- Katılım
- 14 Kasım 2004
- Mesajlar
- 299
- Excel Vers. ve Dili
- microsoft office professional plus 2016
Merhaba ;
aşağıdaki kod ile d9 hücresine bir tarih yazdığımda rapor sayfasına d9 hücresine yazdığım bilgiler geliyor. Acaba bu koda d9 hücresine tarih yazmayıpta, f9 hücresine ilk tarih f10 hücresine son tarihi yazsak tarihler arası dökümü verirmi ?
Private Sub CommandButton2_Click()
Dim i As Long, c As Range, sat As Long, sut As Integer
Dim Sr As Worksheet, syf As String
Set Sr = Sheets("rapor")
Application.ScreenUpdating = False
Sheets("giriş").Select
Sr.Range("A2:K" & Rows.Count).ClearContents
Sr.Range("C1") = Range("D9")
syf = Month(Range("D9"))
sat = 2
With Sheets(syf)
Set c = .Rows(3).Find(Range("D9"), , xlValues, xlWhole)
If Not c Is Nothing Then
sut = c.Column
End If
For i = 4 To .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(i, sut) <> "" Then
Sr.Cells(sat, "A") = .Cells(i, "A")
Sr.Cells(sat, "B") = .Cells(i, "C")
Sr.Cells(sat, "d") = .Cells(i, "ak")
Sr.Cells(sat, "e") = .Cells(i, "al")
Sr.Cells(sat, "f") = .Cells(i, "am")
Sr.Cells(sat, "g") = .Cells(i, "an")
Sr.Cells(sat, "h") = .Cells(i, "ao")
Sr.Cells(sat, "ı") = .Cells(i, "ap")
Sr.Cells(sat, "j") = .Cells(i, "aq")
Sr.Cells(sat, "k") = .Cells(i, "ar")
Sr.Cells(sat, "C") = .Cells(i, sut)
sat = sat + 1
End If
Next i
End With
Application.ScreenUpdating = True
Sheets("rapor").Select
aşağıdaki kod ile d9 hücresine bir tarih yazdığımda rapor sayfasına d9 hücresine yazdığım bilgiler geliyor. Acaba bu koda d9 hücresine tarih yazmayıpta, f9 hücresine ilk tarih f10 hücresine son tarihi yazsak tarihler arası dökümü verirmi ?
Private Sub CommandButton2_Click()
Dim i As Long, c As Range, sat As Long, sut As Integer
Dim Sr As Worksheet, syf As String
Set Sr = Sheets("rapor")
Application.ScreenUpdating = False
Sheets("giriş").Select
Sr.Range("A2:K" & Rows.Count).ClearContents
Sr.Range("C1") = Range("D9")
syf = Month(Range("D9"))
sat = 2
With Sheets(syf)
Set c = .Rows(3).Find(Range("D9"), , xlValues, xlWhole)
If Not c Is Nothing Then
sut = c.Column
End If
For i = 4 To .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(i, sut) <> "" Then
Sr.Cells(sat, "A") = .Cells(i, "A")
Sr.Cells(sat, "B") = .Cells(i, "C")
Sr.Cells(sat, "d") = .Cells(i, "ak")
Sr.Cells(sat, "e") = .Cells(i, "al")
Sr.Cells(sat, "f") = .Cells(i, "am")
Sr.Cells(sat, "g") = .Cells(i, "an")
Sr.Cells(sat, "h") = .Cells(i, "ao")
Sr.Cells(sat, "ı") = .Cells(i, "ap")
Sr.Cells(sat, "j") = .Cells(i, "aq")
Sr.Cells(sat, "k") = .Cells(i, "ar")
Sr.Cells(sat, "C") = .Cells(i, sut)
sat = sat + 1
End If
Next i
End With
Application.ScreenUpdating = True
Sheets("rapor").Select
