Bug en renommant les onglets du classeur

Bonsoir

j ai renommé les onglets de mon classeur et il n'a pas aimé

je cale depuis un bon moment sur ce bug

j ai voulu modifier le code name dans les propriétés mais impossible

merci d'avance pour votre aide

Private Sub CommandButton1_Click()
Dim Ctrl As Control
Dim r As Integer
Dim t As Integer
Dim derligne As Integer

With Worksheets("Feuil2")
derligne = .Range("A65536").End(xlUp).Row + 1

For Each Ctrl In UserForm2.Controls

r = Val(Ctrl.Tag)

If r > 0 Then Feuil2.Cells(derligne, r) = TrouveType(Ctrl)

Next

ComboBox1 = ""
TextBox1 = ""

End With
Unload Me
End Sub

Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)

End Sub
Private Sub UserForm_Initialize()
'spécifie la date du jour lors de l'affichage de l'USF
    DTPicker1.Value = Now

End Sub

Function TrouveType(V)
TrouveType = V
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 And InStr(TrouveType, ":") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd hh:mm"): Exit Function
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd"): Exit Function
If IsNumeric(Replace(TrouveType, ".", ",")) = True Then TrouveType = Replace(TrouveType, ",", "."): Exit Function
End Function
Private Sub TextBox1_Change()
'Kilométrage
'autorise la validation si valeur dans Textbox est numérique

CommandButton1.Enabled = IsNumeric(TextBox1.Value)

End Sub
13saisies.xlsm (41.37 Ko)

Bonjour

Si j'ai compris le problème

Pour l'Userform1

Private Sub CommandButton1_Click()
Dim Ctrl As Control
Dim r As Integer
Dim t As Integer
Dim derligne As Integer

  With Feuil1
    derligne = .Range("A65536").End(xlUp).Row + 1
    For Each Ctrl In UserForm1.Controls
      r = Val(Ctrl.Tag)
      If r > 0 Then .Cells(derligne, r) = TrouveType(Ctrl)
    Next
    TextBox2 = ""
    ComboBox1 = ""
    TextBox4 = ""
    TextBox5 = ""
    TextBox6 = ""
  End With
End Sub

Pour l'Userform2

Private Sub CommandButton1_Click()
Dim Ctrl As Control
Dim r As Integer
Dim t As Integer
Dim derligne As Integer

  With Feuil2
    derligne = .Range("A65536").End(xlUp).Row + 1
    For Each Ctrl In UserForm2.Controls
      r = Val(Ctrl.Tag)
      If r > 0 Then .Cells(derligne, r) = TrouveType(Ctrl)
    Next
    ComboBox1 = ""
    TextBox1 = ""
  End With
  Unload Me
End Sub
Rechercher des sujets similaires à "bug renommant onglets classeur"