Mevcut Verileri Güncellemek.

ahmed_ummu

Altın Üye
Katılım
28 Mart 2011
Mesajlar
750
Excel Vers. ve Dili
Excel 2010 Professional Plus 64 Bit
Altın Üyelik Bitiş Tarihi
15-10-2026
İyi akşamşar arkadaşlar.

Aşağıdaki kod ile mevcut belgileri değiştirmek istiyorum ama kodu çalıştırınca herhangi bir hata vermiyor ama eski verileri yeni veriler ile de değiştirmiyor.
Yardımcı olursanız sevinirim.


Private Sub CommandButton4_Click()

' Verileri güncelle
ActiveCell.Offset(0, 2).Value = TextBox3.Value
ActiveCell.Offset(0, 3).Value = TextBox4.Value
ActiveCell.Offset(0, 4).Value = TextBox5.Value
ActiveCell.Offset(0, 5).Value = TextBox259.Value
ActiveCell.Offset(0, 6).Value = TextBox256.Value
ActiveCell.Offset(0, 7).Value = TextBox257.Value
ActiveCell.Offset(0, 8).Value = TextBox253.Value
ActiveCell.Offset(0, 9).Value = TextBox254.Value
ActiveCell.Offset(0, 10).Value = TextBox258.Value
ActiveCell.Offset(0, 11).Value = TextBox260.Value
ActiveCell.Offset(0, 12).Value = TextBox261.Value
ActiveCell.Offset(0, 13).Value = TextBox252.Value

' Sayfayı yenile
Application.ScreenUpdating = True
ActiveSheet.Calculate
DoEvents

' ListBox güncelleme
Sheets("veri").Select
Range("a4").Select
' ListBox1.Clear
With ListBox1
.ColumnCount = 15
.ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
.RowSource = "a4:n" & WorksheetFunction.Max(4, Cells(Rows.Count, "a").End(xlUp).Row)
End With
End Sub
 

osman06turgut

Herkes İşi Bitince Teşekkür Etmeden Gidecek!!
Altın Üye
Katılım
25 Nisan 2022
Mesajlar
38
Excel Vers. ve Dili
Office 2021-Türkçe
Altın Üyelik Bitiş Tarihi
30-03-2028
Kod:
    With ActiveCell
        .Offset(0, 2).Value = TextBox3.Value
        .Offset(0, 3).Value = TextBox4.Value
        .Offset(0, 4).Value = TextBox5.Value
        .Offset(0, 5).Value = TextBox259.Value
        .Offset(0, 6).Value = TextBox256.Value
        .Offset(0, 7).Value = TextBox257.Value
        .Offset(0, 8).Value = TextBox253.Value
        .Offset(0, 9).Value = TextBox254.Value
        .Offset(0, 10).Value = TextBox258.Value
        .Offset(0, 11).Value = TextBox260.Value
        .Offset(0, 12).Value = TextBox261.Value
        .Offset(0, 13).Value = TextBox252.Value
    End With
 
    Application.ScreenUpdating = False
    
    Set ws = Sheets("veri") 'sayfa ismini girin
    
    sonSatir = Application.WorksheetFunction.Max(4, ws.Cells(ws.Rows.Count, "A").End(xlUp).Row)
    
    With ListBox1
        .ColumnCount = 15
        .ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
        .RowSource = "veri!A4:N" & sonSatir
    End With
    Application.ScreenUpdating = True
 

ahmed_ummu

Altın Üye
Katılım
28 Mart 2011
Mesajlar
750
Excel Vers. ve Dili
Excel 2010 Professional Plus 64 Bit
Altın Üyelik Bitiş Tarihi
15-10-2026
Kod:
    With ActiveCell
        .Offset(0, 2).Value = TextBox3.Value
        .Offset(0, 3).Value = TextBox4.Value
        .Offset(0, 4).Value = TextBox5.Value
        .Offset(0, 5).Value = TextBox259.Value
        .Offset(0, 6).Value = TextBox256.Value
        .Offset(0, 7).Value = TextBox257.Value
        .Offset(0, 8).Value = TextBox253.Value
        .Offset(0, 9).Value = TextBox254.Value
        .Offset(0, 10).Value = TextBox258.Value
        .Offset(0, 11).Value = TextBox260.Value
        .Offset(0, 12).Value = TextBox261.Value
        .Offset(0, 13).Value = TextBox252.Value
    End With

    Application.ScreenUpdating = False
  
    Set ws = Sheets("veri") 'sayfa ismini girin
  
    sonSatir = Application.WorksheetFunction.Max(4, ws.Cells(ws.Rows.Count, "A").End(xlUp).Row)
  
    With ListBox1
        .ColumnCount = 15
        .ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
        .RowSource = "veri!A4:N" & sonSatir
    End With
    Application.ScreenUpdating = True
Sayın osman06turgut kodlar için teşekkür ederim. Kodu çalıştırınca herhangi bir hata vermedi Sadece .Offset(0, 2).Value = TextBox3.Value kod satırını güncelledi diğer satırları güncellemedi.
 

osman06turgut

Herkes İşi Bitince Teşekkür Etmeden Gidecek!!
Altın Üye
Katılım
25 Nisan 2022
Mesajlar
38
Excel Vers. ve Dili
Office 2021-Türkçe
Altın Üyelik Bitiş Tarihi
30-03-2028
Textbox1-2-3-4 devam eder bu bir tanımlamadır. Form üzerinde sanmıyorum ki 252 adet Textbox var! Bunun en basit çözümü Kod Görüntülemede "Form" ekranınızda bulunan TextBox tanımlamalarını kontrol etmenizdir.
 

ahmed_ummu

Altın Üye
Katılım
28 Mart 2011
Mesajlar
750
Excel Vers. ve Dili
Excel 2010 Professional Plus 64 Bit
Altın Üyelik Bitiş Tarihi
15-10-2026
Textbox1-2-3-4 devam eder bu bir tanımlamadır. Form üzerinde sanmıyorum ki 252 adet Textbox var! Bunun en basit çözümü Kod Görüntülemede "Form" ekranınızda bulunan TextBox tanımlamalarını kontrol etmenizdir.
Sayın osman06turgut ilginize teşekkür ederim. Dosyamı göndersem onun üzerinde bakabilir misiniz.

Exceli aç butonu ile exceli açabilirsiniz. Kırmızı renkli buton. Kodlarım yine kırmızı renkli Kayıt Güncelle adlı buton da. Yardımcı olursanız sevinirim.
 

Ekli dosyalar

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,850
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
Bunu denermisiniz.

CSS:
Private Sub CommandButton4_Click()


'sirano = ListBox1.List(ListBox1.ListIndex, 0) + 3
sirano = ListBox1.ListIndex + 4
ListBox1.RowSource = ""

Worksheets("veri").Cells(sirano, 3).Value = TextBox3.Value
Worksheets("veri").Cells(sirano, 4).Value = TextBox4.Value
Worksheets("veri").Cells(sirano, 5).Value = TextBox5.Value
Worksheets("veri").Cells(sirano, 6).Value = TextBox259.Value
Worksheets("veri").Cells(sirano, 7).Value = TextBox257.Value
Worksheets("veri").Cells(sirano, 8).Value = TextBox253.Value
Worksheets("veri").Cells(sirano, 9).Value = TextBox254.Value
Worksheets("veri").Cells(sirano, 10).Value = TextBox258.Value
Worksheets("veri").Cells(sirano, 11).Value = TextBox260.Value
Worksheets("veri").Cells(sirano, 12).Value = TextBox261.Value
Worksheets("veri").Cells(sirano, 13).Value = TextBox252.Value

With ListBox1
.ColumnCount = 15
.ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
.RowSource = "a4:n" & WorksheetFunction.Max(4, Cells(Rows.Count, "a").End(xlUp).Row)
End With
ListBox1.ListIndex = sirano - 4
   
End Sub
 
Son düzenleme:

ahmed_ummu

Altın Üye
Katılım
28 Mart 2011
Mesajlar
750
Excel Vers. ve Dili
Excel 2010 Professional Plus 64 Bit
Altın Üyelik Bitiş Tarihi
15-10-2026
Bunu denermisiniz.

CSS:
Private Sub CommandButton4_Click()


'sirano = ListBox1.List(ListBox1.ListIndex, 0) + 3
sirano = ListBox1.ListIndex + 4
ListBox1.RowSource = ""

Worksheets("veri").Cells(sirano, 3).Value = TextBox3.Value
Worksheets("veri").Cells(sirano, 4).Value = TextBox4.Value
Worksheets("veri").Cells(sirano, 5).Value = TextBox5.Value
Worksheets("veri").Cells(sirano, 6).Value = TextBox259.Value
Worksheets("veri").Cells(sirano, 7).Value = TextBox257.Value
Worksheets("veri").Cells(sirano, 8).Value = TextBox253.Value
Worksheets("veri").Cells(sirano, 9).Value = TextBox254.Value
Worksheets("veri").Cells(sirano, 10).Value = TextBox258.Value
Worksheets("veri").Cells(sirano, 11).Value = TextBox260.Value
Worksheets("veri").Cells(sirano, 12).Value = TextBox261.Value
Worksheets("veri").Cells(sirano, 13).Value = TextBox252.Value

With ListBox1
.ColumnCount = 15
.ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
.RowSource = "a4:n" & WorksheetFunction.Max(4, Cells(Rows.Count, "a").End(xlUp).Row)
End With
ListBox1.ListIndex = sirano - 4
 
End Sub
Halit bey çok teşekkürler sorun çözüldü. Hayırlı Ramazanlar.
Kod:
    With ActiveCell
        .Offset(0, 2).Value = TextBox3.Value
        .Offset(0, 3).Value = TextBox4.Value
        .Offset(0, 4).Value = TextBox5.Value
        .Offset(0, 5).Value = TextBox259.Value
        .Offset(0, 6).Value = TextBox256.Value
        .Offset(0, 7).Value = TextBox257.Value
        .Offset(0, 8).Value = TextBox253.Value
        .Offset(0, 9).Value = TextBox254.Value
        .Offset(0, 10).Value = TextBox258.Value
        .Offset(0, 11).Value = TextBox260.Value
        .Offset(0, 12).Value = TextBox261.Value
        .Offset(0, 13).Value = TextBox252.Value
    End With

    Application.ScreenUpdating = False
  
    Set ws = Sheets("veri") 'sayfa ismini girin
  
    sonSatir = Application.WorksheetFunction.Max(4, ws.Cells(ws.Rows.Count, "A").End(xlUp).Row)
  
    With ListBox1
        .ColumnCount = 15
        .ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
        .RowSource = "veri!A4:N" & sonSatir
    End With
    Application.ScreenUpdating = True
Bunu denermisiniz.

CSS:
Private Sub CommandButton4_Click()


'sirano = ListBox1.List(ListBox1.ListIndex, 0) + 3
sirano = ListBox1.ListIndex + 4
ListBox1.RowSource = ""

Worksheets("veri").Cells(sirano, 3).Value = TextBox3.Value
Worksheets("veri").Cells(sirano, 4).Value = TextBox4.Value
Worksheets("veri").Cells(sirano, 5).Value = TextBox5.Value
Worksheets("veri").Cells(sirano, 6).Value = TextBox259.Value
Worksheets("veri").Cells(sirano, 7).Value = TextBox257.Value
Worksheets("veri").Cells(sirano, 8).Value = TextBox253.Value
Worksheets("veri").Cells(sirano, 9).Value = TextBox254.Value
Worksheets("veri").Cells(sirano, 10).Value = TextBox258.Value
Worksheets("veri").Cells(sirano, 11).Value = TextBox260.Value
Worksheets("veri").Cells(sirano, 12).Value = TextBox261.Value
Worksheets("veri").Cells(sirano, 13).Value = TextBox252.Value

With ListBox1
.ColumnCount = 15
.ColumnWidths = "20;28;93;60;40;60;60;70;45;45;100;30;30;30;30"
.RowSource = "a4:n" & WorksheetFunction.Max(4, Cells(Rows.Count, "a").End(xlUp).Row)
End With
ListBox1.ListIndex = sirano - 4
  
End Sub
Teşekkürler Halit bey. Sorun çözüldü. Hayırlı Ramazanlar.
 
Üst