[ÇÖZÜLDÜ] Diger sayfadan bilgi almak

Katılım
7 Mart 2007
Mesajlar
60
Excel Vers. ve Dili
Excel 2003 almanca
Degerli arkadaslar yapmis oldugum personal listesinde is ten cikarma olayi fazla yer tutugu icin baska bir sayfa actim sorunum personal sayfasindan
kisinin nosunu yazdigimda bilgilerin gelmesi kod lar asagida

Private Sub CommandButton1_Click()
Dim yer, i, mesaj As Integer
yer = 2
While Sheets(1).Cells(yer, 1) <> ""
yer = yer + 1
Wend
yer = yer - 1
For i = 2 To yer
If TextBox1 = Sheets(1).Cells(i, 1) Then
mesaj = MsgBox("Personelin Isine Son Vermek Üzeresiniz Eminmisiniz?", 4 + 32 + 256, "Uyari")
If mesaj = 6 Then
Sheets(1).Cells(i, 24) = TextBox5
ThisWorkbook.Save
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = ""
Else
Cancel = True
End If
End If
Next i
End Sub




Private Sub TextBox1_Change()
TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = ""
Dim yer, i As Integer
yer = 2
While Sheets(1).Cells(yer, 1) <> ""
yer = yer + 1
Wend
yer = yer - 1
For i = 2 To yer
If TextBox1 = Sheets(1).Cells(i, 1) Then
TextBox2 = Sheets(1).Cells(i, 3)
TextBox3 = Sheets(1).Cells(i, 4)
TextBox4 = Sheets(1).Cells(i, 19)
TextBox5 = Sheets(1).Cells(i, 24)
If TextBox5 <> "" Then
MsgBox TextBox5 & Chr(13) & "Bu Personel Zaten Isten Çikarilmi s"
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = ""
End If
End If
Next i

End Sub
Nasil Bir degisiklik yapmam gerekir


 

N.Ziya Hiçdurmaz

Özel Üye
Katılım
28 Nisan 2007
Mesajlar
2,215
Excel Vers. ve Dili
Office 2013 TR / 32 Bit
Yanıt

İlk sayfada bulamadığı veriyi diğer sayfada arar
Kod:
Private Sub CommandButton1_Click()
Dim S1, S2 As Worksheet
Dim BUL, BUL2 As Range
Set S1 = Sheets("Sayfa1")
Set S2 = Sheets("Sayfa2")
Set BUL = S1.Range("A1:A65536").Find(TextBox1)
Set BUL2 = S2.Range("A1:A65536").Find(TextBox1)
If Not BUL Is Nothing Then
TextBox2 = BUL.Offset(0, 1)
Else
TextBox2 = BUL2.Offset(0, 1)
End If
Set S1 = Nothing
Set S2 = Nothing
Set BUL = Nothing
Set BUL2 = Nothing
End Sub
 
Katılım
7 Mart 2007
Mesajlar
60
Excel Vers. ve Dili
Excel 2003 almanca
Tesekürler diger sayfadan bilgiler geliyor istedigim gibi bir kaydet butonu ekleyip cikis sayfasina nasil kayit yapa bilirim zahmet olmasa bu konuda da yardim ede bilirmisiniz

Saygilar
 

N.Ziya Hiçdurmaz

Özel Üye
Katılım
28 Nisan 2007
Mesajlar
2,215
Excel Vers. ve Dili
Office 2013 TR / 32 Bit
Yanıt

Kod:
Private Sub CommandButton2_Click()
Dim S1 As Worksheet
Dim SON As Integer
Set S1 = Sheets("Çıkış")
SON = S1.Cells(65536, "A").End(xlUp).Row + 1
S1.Cells(SON, "A") = TextBox1
S1.Cells(SON, "B") = TextBox2
End Sub
 
Katılım
7 Mart 2007
Mesajlar
60
Excel Vers. ve Dili
Excel 2003 almanca
cok cok sagolun sorun cozuldu

Saygilar
 
Üst