ranger dans une feuille

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

nrdz83

XLDnaute Impliqué
Bonsoir à tous j'ai un classeur avec deux feuille "accueil " et "janvier"
j'utilise ce code
Private Sub CommandButton1_Click()
' Mise en place des valeurs saisies
DerLig = [A65000].End(xlUp).Row + 1
Cells(DerLig, 1) = Calendar1
Cells(DerLig, 2) = ComboBox1
Cells(DerLig, 3) = TextBox3
Cells(DerLig, 4) = TextBox4
Cells(DerLig, 5) = TextBox1
Cells(DerLig, 7) = ComboBox2
Cells(DerLig, 8) = ComboBox3
Cells(DerLig, 9) = ComboBox5
Cells(DerLig, 10) = TextBox2
Cells(DerLig, 11) = ComboBox4
Cells(DerLig, 12) = ComboBox6
Cells(DerLig, 13) = ComboBox7
Cells(DerLig, 14) = ComboBox8
Cells(DerLig, 15) = ComboBox9
Cells(DerLig, 16) = ComboBox10
Cells(DerLig, 17) = ComboBox11
Cells(DerLig, 18) = ComboBox12
Cells(DerLig, 19) = ComboBox13
Cells(DerLig, 20) = ComboBox14
Cells(DerLig, 20) = ComboBox15
' On décharge le formulaire
Unload Me
End Sub



Ces codes fonctionne mais il se range dans la feuille accueil, qu'est ce que je dois rajouter à mon code pour qu'il se range dans ma feuille "janvier" ?

J'ai essayé Range.sheets"janvier"
mais ça marche pas.
D'avance merci à tous, amitiés
 
Re : ranger dans une feuille

Bonsoir,

Avec ceci sans doute:

Code:
Private Sub CommandButton1_Click()
' Mise en place des valeurs saisies
With Sheets("janvier")
  DerLig = .Range("A65000").End(xlUp).Row + 1
  .Cells(DerLig, 1) = Calendar1
  .Cells(DerLig, 2) = ComboBox1
  .Cells(DerLig, 3) = TextBox3
  .Cells(DerLig, 4) = TextBox4
  .Cells(DerLig, 5) = TextBox1
  .Cells(DerLig, 7) = ComboBox2
  .Cells(DerLig, 8) = ComboBox3
  .Cells(DerLig, 9) = ComboBox5
  .Cells(DerLig, 10) = TextBox2
  .Cells(DerLig, 11) = ComboBox4
  .Cells(DerLig, 12) = ComboBox6
  .Cells(DerLig, 13) = ComboBox7
  .Cells(DerLig, 14) = ComboBox8
  .Cells(DerLig, 15) = ComboBox9
  .Cells(DerLig, 16) = ComboBox10
  .Cells(DerLig, 17) = ComboBox11
  .Cells(DerLig, 18) = ComboBox12
  .Cells(DerLig, 19) = ComboBox13
  .Cells(DerLig, 20) = ComboBox14
  .Cells(DerLig, 20) = ComboBox15
End With
' On décharge le formulaire
Unload Me
End Sub

A+
 
Re : ranger dans une feuille

bonsoir et merci hasco voici donc mon code
Private Sub CommandButton1_Click()
' Mise en place des valeurs saisies
With Sheets("Janvier")
DerLig = [A65000].End(xlUp).Row + 1
Cells(DerLig, 1) = Calendar1
Cells(DerLig, 2) = ComboBox1
Cells(DerLig, 3) = TextBox3
Cells(DerLig, 4) = TextBox4
Cells(DerLig, 5) = TextBox1
Cells(DerLig, 7) = ComboBox2
Cells(DerLig, 8) = ComboBox3
Cells(DerLig, 9) = ComboBox5
Cells(DerLig, 10) = TextBox2
Cells(DerLig, 11) = ComboBox4
Cells(DerLig, 12) = ComboBox6
Cells(DerLig, 13) = ComboBox7
Cells(DerLig, 14) = ComboBox8
Cells(DerLig, 15) = ComboBox9
Cells(DerLig, 16) = ComboBox10
Cells(DerLig, 17) = ComboBox11
Cells(DerLig, 18) = ComboBox12
Cells(DerLig, 19) = ComboBox13
Cells(DerLig, 20) = ComboBox14
Cells(DerLig, 20) = ComboBox15
End With
' On décharge le formulaire
Unload Me
End Sub



et ça me range toujous dans ma feuille accueil , merci d'avance
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
2 K
Retour