Merhaba arkadaşlar sayfadaki verileri TextBox ve ComboBox lara alarak aşağıdaki kodlarla verileri değiştiriyorum. Değiştir İşlemini yaptığım zaman Bütün TextBox ve ComboBox'ların dolu olması lazım birtasnesi boş olsa hata veriyor.
Benim istediğim TextBox ve ComboBox'lardan boş olan varsa ginede verileri değiştirsin hata vermesin.
Private Sub CommandButton12_Click()
MsgBox "KAYIT DEĞİŞTİRİLDİ!!!"
satır = ActiveCell.Row
ActiveCell.Offset(0, 1).Value = CDate(ComboBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox3.Value
ActiveCell.Offset(0, 3).Value = CDbl(TextBox3.Value)
ActiveCell.Offset(0, 4).Value = CDbl(TextBox4.Value)
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5.Value)
ActiveCell.Offset(0, 6).Value = CDbl(TextBox10.Value)
ActiveCell.Offset(0, 7).Value = CDbl(TextBox11.Value)
ActiveCell.Offset(0, 8).Value = CDbl(TextBox13.Value)
ActiveCell.Offset(0, 9).Value = CDbl(TextBox6.Value)
ActiveCell.Offset(0, 10).Value = CDbl(TextBox7.Value)
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$" & [A65536].End(3).Row
Range("A65535").End(xlUp).Offset(1, 0).Select
ComboBox2.SetFocus
CommandButton2_Click
TextBox8.Text = [L4]
TextBox9.Text = [L6]
ComboBox2.Text = [L7]
UserForm_Initialize
ListBox1.ListIndex = ListBox1.ListCount - 1 'ListBoxın son satırına gider.'
Range("A65535").End(xlUp).Offset(1, 0).Select 'Son boş satıra gider
End Sub
Benim istediğim TextBox ve ComboBox'lardan boş olan varsa ginede verileri değiştirsin hata vermesin.
Private Sub CommandButton12_Click()
MsgBox "KAYIT DEĞİŞTİRİLDİ!!!"
satır = ActiveCell.Row
ActiveCell.Offset(0, 1).Value = CDate(ComboBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox3.Value
ActiveCell.Offset(0, 3).Value = CDbl(TextBox3.Value)
ActiveCell.Offset(0, 4).Value = CDbl(TextBox4.Value)
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5.Value)
ActiveCell.Offset(0, 6).Value = CDbl(TextBox10.Value)
ActiveCell.Offset(0, 7).Value = CDbl(TextBox11.Value)
ActiveCell.Offset(0, 8).Value = CDbl(TextBox13.Value)
ActiveCell.Offset(0, 9).Value = CDbl(TextBox6.Value)
ActiveCell.Offset(0, 10).Value = CDbl(TextBox7.Value)
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$" & [A65536].End(3).Row
Range("A65535").End(xlUp).Offset(1, 0).Select
ComboBox2.SetFocus
CommandButton2_Click
TextBox8.Text = [L4]
TextBox9.Text = [L6]
ComboBox2.Text = [L7]
UserForm_Initialize
ListBox1.ListIndex = ListBox1.ListCount - 1 'ListBoxın son satırına gider.'
Range("A65535").End(xlUp).Offset(1, 0).Select 'Son boş satıra gider
End Sub
