Erdinç FIRTINA
Altın Üye
- Katılım
- 14 Şubat 2007
- Mesajlar
- 400
- Excel Vers. ve Dili
- excel 2003 türkçe
Değerli Üyeler,
TextBox formatı aşağıdaki gibidir. Bu formata göre de, text lerde tarih formatı (dd/mm/yyyy) oluyor. Örneğin; textler üzerinde, formata bağlı olarak 3/5/4 girdiğimde texten çıkarken 03/05/2004 e dönüşüyor. Ancak, verileri excel sayfasına aktarırken gün ile ayın yeri değişerek 05/03/2008 olarak aktarıyor.
Yardımlarınız için şimdiden teşekkürler!!!
Private Sub CommandButton1_Click()
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
Range("A1") = "SIRA NO"
Range("B1") = "ADI SOYADI"
If TextBox1.Value = "" Then
MsgBox "VERİ GİRİNİZ"
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
Unload Me
UserForm2.Show
Exit Sub
End If
If IsDate(TextBox5.Value) Then
TextBox5.Value = Format(TextBox5.Value, "dd/mm/yyyy")
If TextBox5 > TextBox28 Then
TextBox6 = DateDiff("yyyy", TextBox28, TextBox5)
Else
TextBox6 = DateDiff("yyyy", TextBox5, TextBox28)
End If
Else
MsgBox ("Lütfen Tarih Giriniz")
Exit Sub
End If
For sira = 1 To WorksheetFunction.CountA(Range("B1:B65536"))
Range("A" & sira + 1) = sira
Next
For Each bak In Range("B1:B" & WorksheetFunction.CountA(Range("B1:B65536")))
If bak = TextBox1 Then
MsgBox "Bu isimde bir kaydınız mevcut"
Range("A1").Select
Unload Me
UserForm3.Show
Exit Sub
End If
Next
say = WorksheetFunction.CountA(Range("B1:B65536")) + 1
If OptionButton1.Value = True Then Range("K" & say) = "ÇALIŞIYOR"
If OptionButton2.Value = True Then Range("K" & say) = "ÇALIŞMIYOR"
If OptionButton1.Value = False And OptionButton2.Value = False Then
MsgBox "LÜTFEN ÇALIŞIP ÇALIŞMADIĞINI BELİRTİNİZ"
Exit Sub
End If
Range("B" & say) = TextBox1.Value
'Range("C" & say) = TextBox2.Value
'Range("D" & say) = TextBox3.Value
Range("E" & say) = TextBox4.Value
Range("F" & say) = TextBox5.Value
Range("G" & say) = TextBox6.Value
[C2
65536].Clear
For i = 2 To Cells(65536, 2).End(xlUp).Row
a = Split(Cells(i, 2), " ")
For j = 0 To UBound(a) - 1
Cells(i, 3) = Trim(Cells(i, 3) & " " & a(j))
Next j
Cells(i, 4) = Trim(a(UBound(a)))
Next i
Columns("B:K").EntireColumn.AutoFit
Columns("B:K").Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
ActiveWorkbook.Save
Unload Me
UserForm3.Show
Exit Sub
End Sub
Private Sub TextBox5_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsDate(TextBox5.Value) Then
TextBox5.Value = Format(TextBox5.Value, "dd/mm/yyyy")
Else
MsgBox ("Lütfen Tarih Giriniz")
Exit Sub
End If
End Sub
Private Sub TextBox6_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
TextBox6 = Empty
End Sub
Private Sub UserForm_Initialize()
TextBox28 = Format(Date, "dd/mm/yyyy")
TextBox5 = Format(TextBox5.Value, "dd/mm/yyyy")
End Sub
TextBox formatı aşağıdaki gibidir. Bu formata göre de, text lerde tarih formatı (dd/mm/yyyy) oluyor. Örneğin; textler üzerinde, formata bağlı olarak 3/5/4 girdiğimde texten çıkarken 03/05/2004 e dönüşüyor. Ancak, verileri excel sayfasına aktarırken gün ile ayın yeri değişerek 05/03/2008 olarak aktarıyor.
Yardımlarınız için şimdiden teşekkürler!!!
Private Sub CommandButton1_Click()
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
Range("A1") = "SIRA NO"
Range("B1") = "ADI SOYADI"
If TextBox1.Value = "" Then
MsgBox "VERİ GİRİNİZ"
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
Unload Me
UserForm2.Show
Exit Sub
End If
If IsDate(TextBox5.Value) Then
TextBox5.Value = Format(TextBox5.Value, "dd/mm/yyyy")
If TextBox5 > TextBox28 Then
TextBox6 = DateDiff("yyyy", TextBox28, TextBox5)
Else
TextBox6 = DateDiff("yyyy", TextBox5, TextBox28)
End If
Else
MsgBox ("Lütfen Tarih Giriniz")
Exit Sub
End If
For sira = 1 To WorksheetFunction.CountA(Range("B1:B65536"))
Range("A" & sira + 1) = sira
Next
For Each bak In Range("B1:B" & WorksheetFunction.CountA(Range("B1:B65536")))
If bak = TextBox1 Then
MsgBox "Bu isimde bir kaydınız mevcut"
Range("A1").Select
Unload Me
UserForm3.Show
Exit Sub
End If
Next
say = WorksheetFunction.CountA(Range("B1:B65536")) + 1
If OptionButton1.Value = True Then Range("K" & say) = "ÇALIŞIYOR"
If OptionButton2.Value = True Then Range("K" & say) = "ÇALIŞMIYOR"
If OptionButton1.Value = False And OptionButton2.Value = False Then
MsgBox "LÜTFEN ÇALIŞIP ÇALIŞMADIĞINI BELİRTİNİZ"
Exit Sub
End If
Range("B" & say) = TextBox1.Value
'Range("C" & say) = TextBox2.Value
'Range("D" & say) = TextBox3.Value
Range("E" & say) = TextBox4.Value
Range("F" & say) = TextBox5.Value
Range("G" & say) = TextBox6.Value
[C2
For i = 2 To Cells(65536, 2).End(xlUp).Row
a = Split(Cells(i, 2), " ")
For j = 0 To UBound(a) - 1
Cells(i, 3) = Trim(Cells(i, 3) & " " & a(j))
Next j
Cells(i, 4) = Trim(a(UBound(a)))
Next i
Columns("B:K").EntireColumn.AutoFit
Columns("B:K").Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("PERSONEL_BİLGİLERİ").Select
Range("A1").Select
ActiveWorkbook.Save
Unload Me
UserForm3.Show
Exit Sub
End Sub
Private Sub TextBox5_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsDate(TextBox5.Value) Then
TextBox5.Value = Format(TextBox5.Value, "dd/mm/yyyy")
Else
MsgBox ("Lütfen Tarih Giriniz")
Exit Sub
End If
End Sub
Private Sub TextBox6_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
TextBox6 = Empty
End Sub
Private Sub UserForm_Initialize()
TextBox28 = Format(Date, "dd/mm/yyyy")
TextBox5 = Format(TextBox5.Value, "dd/mm/yyyy")
End Sub
