Makro Düzenleme

Katılım
9 Ekim 2009
Mesajlar
1,626
Excel Vers. ve Dili
türkçe
2003
Aşağıdaki makroda bu haftalık duruşmaları seçtiğim zaman makro diğer aydaki duruşmalarıda gösteriyo acaba bunu bir haftalık tarihi göstermesi için nasıl düzenleriz?


Sub Hafta()
Dim s, Dosya_Yolu As String
Dosya_Yolu = ThisWorkbook.Path & "\"
ExecuteExcel4Macro ("SOUND.PLAY(, """ & Dosya_Yolu & "ding.wav"")")
Set s1 = Sheets("KAYIT")
Set s2 = Sheets("DURUŞMALAR")
s2.Select
s2.Range("A2:M65536").ClearContents
s1.Select
For i = 2 To s1.Range("A65536").End(3).Row
aa = Format(s1.Cells(i, "BY").Value, "dd.mm.yyyy")
bb = Format(Date, "dd.mm.yyyy")
cc = Format(Date + 7, "dd.mm.yyyy")
If aa >= bb And aa <= cc Then
s2.Select
sonsat = s2.Range("A65536").End(3).Row + 1
s2.Cells(sonsat, "A").Value = s1.Cells(i, "BY").Value
s2.Cells(sonsat, "B").Value = s1.Cells(i, "A").Value
s2.Cells(sonsat, "C").Value = s1.Cells(i, "B").Value
s2.Cells(sonsat, "D").Value = s1.Cells(i, "C").Value
s2.Cells(sonsat, "E").Value = s1.Cells(i, "D").Value
s2.Cells(sonsat, "F").Value = s1.Cells(i, "E").Value
s2.Cells(sonsat, "G").Value = s1.Cells(i, "F").Value
s2.Cells(sonsat, "H").Value = s1.Cells(i, "L").Value
s2.Cells(sonsat, "I").Value = s1.Cells(i, "Q").Value
s2.Cells(sonsat, "J").Value = s1.Cells(i, "AR").Value
s2.Cells(sonsat, "K").Value = s1.Cells(i, "BW").Value
s2.Cells(sonsat, "L").Value = s1.Cells(i, "BX").Value
s2.Cells(sonsat, "M").Value = s1.Cells(i, "AP").Value
End If
Next
Sheets("DURUŞMALAR").Select
ActiveWindow.SelectedSheets.PrintPreview
Sheets("DETAYLI DAVA TAKİP").Select
End Sub
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,786
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
bunun yerine
Kod:
bb = Format(Date, "dd.mm.yyyy")
bunu ekle
Kod:
bb = CDate(s1.Cells(1, "A").Value)
bunun yerine
Kod:
cc = Format(Date + 7, "dd.mm.yyyy")
bunu ekle

Kod:
cc = CDate(s1.Cells(1, "B").Value)

kayıt sayfasına a1 ve b1 hücrelerine başlangıç ve bitiş tarihlerini elle yaz makroyu çalıştır.
 
Üst