Textbox yardım

Katılım
11 Ağustos 2005
Mesajlar
239
arkadaşlar aşağıdaki kodlar sayfadan bilgileri alıp textbox ta gösteriyor ama başka bir sayfaya geçersem oradaki bilgileri alıyor ben sadece sayfa1 den bilgi almasını istiyorum nasıl yaparım

Private Sub TextBox1_Change()
With ListBox1
.ColumnCount = 8
.ColumnWidths = "100;50;50;50;50;50;50;50;"
End With
ListBox1.Clear
For suz = 2 To WorksheetFunction.CountA([b1:b65536])
alan = UCase(Replace(Replace(Range("b" & suz), "ı", "I"), "i", "İ"))
veri = UCase(Replace(Replace(TextBox1, "ı", "I"), "i", "İ"))
If alan Like "*" & veri & "*" Then
ListBox1.AddItem
ListBox1.List(s, 0) = Range("B" & suz)
ListBox1.List(s, 1) = Range("C" & suz)
ListBox1.List(s, 2) = Range("D" & suz)
ListBox1.List(s, 3) = Range("E" & suz)
ListBox1.List(s, 4) = Range("F" & suz)
ListBox1.List(s, 5) = Range("G" & suz)
ListBox1.List(s, 6) = Range("H" & suz)
ListBox1.List(s, 7) = Range("I" & suz)
s = s + 1
End If
Next
End Sub

Private Sub UserForm_Initialize()
TextBox1 = "."
TextBox1 = ""
End Sub
 

hamitcan

Uzman
Uzman
Katılım
1 Temmuz 2004
Mesajlar
7,701
Excel Vers. ve Dili
Excel 2019 Türkçe
Kod:
ListBox1.List(s, 0) = Range("B" & suz)
şeklindeki satırları,
Kod:
ListBox1.List(s, 0) = Sayfa1.Range("B" & suz)
şeklinde düzeltin.
 
Katılım
11 Ağustos 2005
Mesajlar
239
teşekkürler
arkadaşım birde aşağıdaki problem var burada textbox tan sayfaya yeni kayıt giriyorum yazdığım firma var ise FİRMA KAYDI VAR diyor evet diye onaylarsam onu değiştirmeyip aşağıya yeni kayıt ekliyor ben o firmanın bilgilerini değiştirsin üzerine yazsın istiyorum

Private Sub CommandButton1_Click()
If TextBox1.Value <> "" Then
Sheets("Sayfa6").Activate
Cells(3, 1).Select
Do While ActiveCell.Value <> ""
If Trim(ActiveCell.Value) = Trim(Me.TextBox1.Value) Then
If MsgBox(Me.TextBox1 & " FİRMA KAYDI VAR." & " DEĞİŞİKLİK YAPMAK İSTİYORMUSUNUZ?", vbYesNo, "Mükerrer Kayıt") = vbNo Then Exit Sub
End If
ActiveCell.Offset(1, 0).Activate
Loop
ActiveCell.Value = TextBox1.Value
ActiveCell.Offset(0, 1).Value = TextBox2.Value
ActiveCell.Offset(0, 2).Value = TextBox3.Value
ActiveCell.Offset(0, 3).Value = TextBox4.Value
End If
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub




Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
 

hamitcan

Uzman
Uzman
Katılım
1 Temmuz 2004
Mesajlar
7,701
Excel Vers. ve Dili
Excel 2019 Türkçe
K&#252;&#231;&#252;k bir dosya ekleyin.
 

hamitcan

Uzman
Uzman
Katılım
1 Temmuz 2004
Mesajlar
7,701
Excel Vers. ve Dili
Excel 2019 Türkçe
Aşağıdaki kodu önceki ile değiştirip dener misiniz?
Kod:
Private Sub CommandButton1_Click()
If TextBox1.Value <> "" Then
Sheets("Sayfa6").Activate
Cells(3, 1).Select
Do While ActiveCell.Value <> ""

ActiveCell.Offset(1, 0).Activate

If Trim(ActiveCell.Text) = Trim(TextBox1.Text) Then
If MsgBox(TextBox1 & " FİRMA KAYDI VAR." & " DEĞİŞİKLİK YAPMAK İSTİYORMUSUNUZ?", vbYesNo, "Mükerrer Kayıt") = vbNo Then Exit Sub
ActiveCell.Value = TextBox1.Value
ActiveCell.Offset(0, 1).Value = TextBox2.Value
ActiveCell.Offset(0, 2).Value = TextBox3.Value
ActiveCell.Offset(0, 3).Value = TextBox4.Value

End If
Loop
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End If
End Sub
 
Üst