Ich möchte den VBA-Code fragen, den ich unten erstellt habe. Nach dem Test ändert sich der Blattwert nicht mehr. Wie behebe ich diesen Code, damit der Wert, den ich eingegeben habe, im Blatt aktualisiert werden kann?Warum ändert diese vba Formel den Wert des Blattes nicht?
Private Sub cmdupdate_click()
Application.ScreenUpdating = False
Dim noM As Integer
'warning
If txtName.Value = "" Then
MsgBox "Insert Name.", vbExclamation
txtName.SetFocus
Exit Sub
End If
If Me.cmbslno.Value = "" Then
MsgBox "No Number!!!", vbExclamation, "Number"
Exit Sub
End If
noM = Me.cmbslno.Value
Sheets("data").Select
Dim bre As Double
Dim msg As String
Dim org As String
bre = Me.cmbslno.Value
bre = bre + 1
Rows(bre).Select
Cells(bre, 2) = Me.txtName.Value
Cells(bre, 3) = Me.txtPanggilan.Value
Cells(bre, 4) = Me.txtNis.Value
Cells(bre, 5) = Me.txtNisn.Value
Cells(bre, 6) = Me.txtTtl.Value
Cells(bre, 7) = Me.CmbJk.Value
Cells(bre, 8) = Me.CmbAgama.Value
Cells(bre, 9) = Me.txtSAwal.Value
Cells(bre, 10) = Me.txtASiswa.Value
Cells(bre, 11) = Me.txtAyah.Value
Cells(bre, 12) = Me.txtIbu.Value
Cells(bre, 13) = Me.txtPAyah.Value
Cells(bre, 14) = Me.txtPIbu.Value
Cells(bre, 15) = Me.txtJln.Value
Cells(bre, 16) = Me.txtDesa.Value
Cells(bre, 17) = Me.txtKec.Value
Cells(bre, 18) = Me.txtKab.Value
Cells(bre, 19) = Me.txtPro.Value
Cells(bre, 20) = Me.txtHp.Value
Cells(bre, 21) = Me.txtWali.Value
Cells(bre, 22) = Me.txtPWali.Value
Cells(bre, 23) = Me.txtAWali.Value
Cells(bre, 36) = Me.txtFoto.Value
bre = bre - 1
msg = "Number " & bre & ". For " & txtName.Value & " Updating . Continue?"
Unload Me
org = MsgBox(msg, vbYesNo, "Confirm")
If org = vbYes Then
Me.FormData.Show
Else
Sheets("Data").Select
End If
Application.ScreenUpdating = True
End Sub
Vielen Dank, hoffen, dass es Ihre aktualisierten Code
Können Sie Ihren Code bitte einrücken. – litelite
Hast du einen Haltepunkt eingebaut, um zu testen, ob er tatsächlich läuft? – litelite