• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Farklı Sayfalara Aynı Anda Veri Ekleme

  • Konbuyu başlatan Konbuyu başlatan Brigade
  • Başlangıç tarihi Başlangıç tarihi
Katılım
28 Şubat 2016
Mesajlar
18
Excel Vers. ve Dili
2010, 2013
Merhaba,

Aşağıda yazmış olduğum kodlamada sadece sayfa1'e veri giriyor. Ben ise 'Ekle' butonuna bastığım takdirde sayfa1,sayfa2 ve sayfa3'e aynı sıra ve sütunda aynı verileri girmesini istiyorum. Bu konuda yardımcı olabilir misiniz?

Kod:
Private Sub EkleButon1_Click()
Dim satir As Integer
Dim satir1 As Integer
Dim satir2 As Integer
Dim ws As Worksheet

If (Trim(Tarihtxtbox.Value) = "") Or (Trim(Firmatxtbox.Value) = "") Or (Trim(Modeltxtbox.Value) = "") Or (Trim(Renktxtbox.Value) = "") Or (Trim(Adettxtbox.Value) = "") Or (Trim(BFtxtbox.Value) = "") Or (Trim(Kurtxtbox.Value) = "") Or (Trim(PBcombobox.Value) = "") Or (Trim(BFcombobox.Value) = "") Then
MsgBox "Bütün Bilgileri Giriniz"
Exit Sub
End If

Set ws = Worksheets("Sayfa1")
satir = WorksheetFunction.CountA(Range("B:B")) + 4
Cells(satir, 2).Value = Tarihtxtbox.Value
Cells(satir, 3).Value = Firmatxtbox.Value
Cells(satir, 4).Value = Modeltxtbox.Value
Cells(satir, 5).Value = Renktxtbox.Value
Cells(satir, 6).Value = Adettxtbox.Value
Cells(satir, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
Cells(satir, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
Cells(satir, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value

Set ws = Worksheets("Sayfa2")
satir1 = WorksheetFunction.CountA(Range("B:B")) + 4
Cells(satir, 2).Value = Tarihtxtbox.Value
Cells(satir, 3).Value = Firmatxtbox.Value
Cells(satir, 4).Value = Modeltxtbox.Value
Cells(satir, 5).Value = Renktxtbox.Value
Cells(satir, 6).Value = Adettxtbox.Value
Cells(satir, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
Cells(satir, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
Cells(satir, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value

Set ws = Worksheets("Sayfa3")
satir2 = WorksheetFunction.CountA(Range("B:B")) + 4
Cells(satir, 2).Value = Tarihtxtbox.Value
Cells(satir, 3).Value = Firmatxtbox.Value
Cells(satir, 4).Value = Modeltxtbox.Value
Cells(satir, 5).Value = Renktxtbox.Value
Cells(satir, 6).Value = Adettxtbox.Value
Cells(satir, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
Cells(satir, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
Cells(satir, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value
End Sub
 
Ekteki gibi dermişiniz.


Kod:
Private Sub EkleButon1_Click()
Dim satir As Integer
Dim satir1 As Integer
Dim satir2 As Integer
Dim ws As Worksheet

If (Trim(Tarihtxtbox.Value) = "") Or (Trim(Firmatxtbox.Value) = "") Or (Trim(Modeltxtbox.Value) = "") Or (Trim(Renktxtbox.Value) = "") Or (Trim(Adettxtbox.Value) = "") Or (Trim(BFtxtbox.Value) = "") Or (Trim(Kurtxtbox.Value) = "") Or (Trim(PBcombobox.Value) = "") Or (Trim(BFcombobox.Value) = "") Then
MsgBox "Bütün Bilgileri Giriniz"
Exit Sub
End If

Set ws1 = Worksheets("Sayfa1")
satir1 = WorksheetFunction.CountA(ws1.Range("B:B")) + 4
ws1.Cells(satir1, 2).Value = Tarihtxtbox.Value
ws1.Cells(satir1, 3).Value = Firmatxtbox.Value
ws1.Cells(satir1, 4).Value = Modeltxtbox.Value
ws1.Cells(satir1, 5).Value = Renktxtbox.Value
ws1.Cells(satir1, 6).Value = Adettxtbox.Value
ws1.Cells(satir1, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
ws1.Cells(satir1, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
ws1.Cells(satir1, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value

Set ws2 = Worksheets("Sayfa2")
satir2 = WorksheetFunction.CountA(ws2.Range("B:B")) + 4
ws2.Cells(satir2, 2).Value = Tarihtxtbox.Value
ws2.Cells(satir2, 3).Value = Firmatxtbox.Value
ws2.Cells(satir2, 4).Value = Modeltxtbox.Value
ws2.Cells(satir2, 5).Value = Renktxtbox.Value
ws2.Cells(satir2, 6).Value = Adettxtbox.Value
ws2.Cells(satir2, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
ws2.Cells(satir2, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
ws2.Cells(satir2, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value

Set ws3 = Worksheets("Sayfa3")
satir3 = WorksheetFunction.CountA(ws3.Range("B:B")) + 4
ws3.Cells(satir3, 2).Value = Tarihtxtbox.Value
ws3.Cells(satir3, 3).Value = Firmatxtbox.Value
ws3.Cells(satir3, 4).Value = Modeltxtbox.Value
ws3.Cells(satir3, 5).Value = Renktxtbox.Value
ws3.Cells(satir3, 6).Value = Adettxtbox.Value
ws3.Cells(satir3, 7).Value = BFtxtbox.Value & " " & BFcombobox.Value
ws3.Cells(satir3, 8).Value = Kurtxtbox.Value & " " & PBcombobox.Value
ws3.Cells(satir3, 9).Value = Adettxtbox.Value * BFtxtbox.Value * Kurtxtbox.Value
End Sub
 
Huseyinkis hocam, yardımınız için çok teşekkür ederim.

Saygılarımla
 
Geri
Üst