Afficher les données dans un formulaire et proteger

cpestian

XLDnaute Nouveau
:eek:Bonjour le forum
je stagne un peu, quelques soucis dans les fonctionnements me bloquent dans l'avancée de mon travail, si l’un d’entre vous a le temps et la patience de bien vouloir m’aider, merci

J'ai un formulaire "Fsaisie" qui me permet de saisir de nouvelles données s’affichant dans un tableau d’une feuille nommée "2010" après validation.
1er souci: Afficher les éléments déjà saisie dans le formulaire pour modification, en double-cliquant sur une cellule colonne A2 du tableau "2010" colonne contenant un n° automatique après validation. le formulaire doit aussi changer de nom.
End With
If flagL Then
Me.Caption = "MODIFICATION D'UNE FICHE"
Inictl (nLign)
Else
Me.Caption = "AJOUT D'UNE FICHE"
End If
Mais voilà je ne trouve pas pourquoi ça ne fonctionne pas.
2eme souci: Une protection sur la feuille 2010 qui évite de modifier directement les données sur la feuille "2010", mais elle ne fonctionne pas, pourtant la formule vba Unprotect et protect est active?
Sub Transfert(vLign As Long)
With ActiveSheet
.Unprotect
.Cells(vLign, 1) = CLng(Label2)
.Cells(vLign, 2) = UCase(TextBox1)
.Cells(vLign, 3) = ComboBox3
.Cells(vLign, 4) = ComboBox1
.Cells(vLign, 6) = TextBox2
.Cells(vLign, 7) = TextBox5
.Cells(vLign, 8) = TextBox7
.Cells(vLign, 9) = ComboBox2
.Cells(vLign, 10) = TextBox9
.Cells(vLign, 11) = ComboBox52
For i = 1 To 7
If Controls("CheckBox" & i) Then .Cells(vLign, i + 11) = 1
Next
If IsDate(TextBox3) Then .Cells(vLign, 5) = CDate(TextBox3) Else: .Cells(vLign, 5) = ""
If IsDate(TextBox6) Then .Cells(vLign, 23) = CDate(TextBox6) Else: .Cells(vLign, 23) = ""
If IsDate(TextBox37) Then .Cells(vLign, 32) = CDate(TextBox37) Else: .Cells(vLign, 32) = ""
If IsDate(TextBox36) Then .Cells(vLign, 39) = CDate(TextBox36) Else: .Cells(vLign, 39) = ""
If IsDate(TextBox15) Then .Cells(vLign, 97) = CDate(TextBox15) Else: .Cells(vLign, 41) = ""
.Cells(vLign, 19) = TextBox48
.Cells(vLign, 20) = TextBox11
.Cells(vLign, 21) = TextBox10
.Cells(vLign, 22) = TextBox12
.Cells(vLign, 24) = TextBox13
.Cells(vLign, 25) = ComboBox6
.Cells(vLign, 26) = TextBox14
.Cells(vLign, 27) = ComboBox11
.Cells(vLign, 28) = ComboBox12
.Cells(vLign, 29) = ComboBox53
.Cells(vLign, 30) = ComboBox48
.Cells(vLign, 31) = TextBox18
.Cells(vLign, 33) = TextBox47
.Cells(vLign, 34) = ComboBox14
.Cells(vLign, 35) = ComboBox13
.Cells(vLign, 36) = ComboBox54
.Cells(vLign, 37) = ComboBox47
.Cells(vLign, 38) = TextBox19
.Cells(vLign, 40) = TextBox46
.Cells(vLign, 98) = TextBox15
.Cells(vLign, 98) = TextBox16
.Cells(vLign, 99) = ComboBox10
.Cells(vLign, 100) = TextBox17
.Protect
End With

End Sub

Je joins un fichier exemple
Merci pour votre aide
 

Pièces jointes

  • Fsaisie.zip
    22 bytes · Affichages: 47
Dernière édition:

Discussions similaires

H
Réponses
3
Affichages
890
HugoB99
H