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?
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
