DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton1_Click()
Dim i As Long
range("A:A").clear
For i = CDate(TextBox1.Value) To CDate(TextBox2.Value)
sat = sat + 1
Cells(sat, "A").Value = CDate(i)
Next i
MsgBox "bitti"
End Sub
Bir satır ilave ettim.sayın üstadım siz bir harikasınız, Allah sizden razı olsun, tam istediğim gibi
Private Sub CommandButton1_Click()
Dim i As Long, tar As Date, sat As Long
Range("B:C").ClearContents
sat = 1
tar = CDate(TextBox1.Value)
Do While tar <= CDate(TextBox2.Value)
Cells(sat, "B").Value = tar
If Month(tar) < 6 Then
tar = VBA.DateSerial(Year(tar), 7, 1) - 1
Cells(sat, "C").Value = tar
Else
tar = VBA.DateSerial(Year(tar) + 1, 1, 1) - 1
Cells(sat, "C").Value = tar
End If
sat = sat + 1
tar = VBA.DateSerial(Year(tar) + 1, 1, 1)
Loop
MsgBox "bitti"
End Sub
Private Sub CommandButton1_Click()
Dim i As Long, tar As Date, sat As Long, yil As Integer
Dim ay As Integer, gun As Date, gunler As Long
Range("B5:C" & Rows.Count).ClearContents
sat = 5
tar = CDate(TextBox1.Value)
gun = VBA.DateDiff("d", tar, CDate(TextBox2.Value))
yil = gun / 365
ay = (gun - (yil * 365)) / 30
gunler = gun - ((yil * 365) + (ay * 30))
TextBox3.Value = yil & " Yıl," & ay & " Ay," & gunler & " Gün"
Do While tar <= CDate(TextBox2.Value)
Cells(sat, "B").Value = tar
If Month(tar) < 6 Then
tar = VBA.DateSerial(Year(tar), 7, 1) - 1
Cells(sat, "C").Value = tar
Else
tar = VBA.DateSerial(Year(tar) + 1, 1, 1) - 1
Cells(sat, "C").Value = tar
End If
sat = sat + 1
tar = VBA.DateSerial(Year(tar) + 1, 1, 1)
Loop
MsgBox "bitti"
End Sub
1-ilk tarih 15.7.2012 değilde 15.4.2012 ise nasıl dağıtılacak?
2-ilk tarih 15.7.2012 değilde 15.8.2012 olursa nasıl dağıtılacak?
Bir tane commondbuton ekleyin ona aşağıdaki kodları girin.
Kod:Private Sub CommandButton1_Click() Dim i As Long range("A:A").clear For i = CDate(TextBox1.Value) To CDate(TextBox2.Value) sat = sat + 1 Cells(sat, "A").Value = CDate(i) Next i MsgBox "bitti" End Sub