Ecrire sur deux pages

bonjour

dans une TextBox j'écrit du texte pour qu'il se mette sur une page - ca marche nickel.

j'aimerais que ca ce mette sur deux pages.

pour l'instant mon code qui marche est :

Private Sub CommandButton1_Click()
Dim ligne As Integer
ligne = Sheets("liste").[a1].End(xlDown).Row + 1
Sheets("liste").Range("a" & ligne) = TextBoxListe
Unload UserFormListe
End Sub

et j'aimerais que ca écrive aussi sur ma page "attente"

Bonjour franck aze, le forum,

A tester...

Private Sub CommandButton1_Click()
 Dim tb, sh As Worksheet, ligne As Integer
  Set tb = Sheets(Array("liste", "attente")) 'nom de tes feuilles
   Application.ScreenUpdating = False
    For Each sh In tb
     ligne = sh.Range("A" & Rows.Count).End(xlUp).Row + 1
     sh.Range("a" & ligne) = TextBoxListe
    Next sh
   Unload UserFormListe
 MsgBox "Enregistrement effectué", vbInformation
End Sub

Sinon, il te suffit de définir une ligne pour ta feuille attente, puis d'écrire sur cette ligne ....

Private Sub CommandButton1_Click()
 Dim ligne As Integer, lig As Integer
  ligne = Sheets("liste").Range("A" & Rows.Count).End(xlUp).Row + 1
    lig = Sheets("attente").Range("A" & Rows.Count).End(xlUp).Row + 1
   Sheets("liste").Range("a" & ligne) = TextBoxListe
   Sheets("attente").Range("a" & lig) = TextBoxListe
  Unload UserFormListe
 MsgBox "Enregistrement effectué", vbInformation
End Sub

Cordialement,

un grand merci

j'ai utilisé la deuxième solution

merci encore

Rechercher des sujets similaires à "ecrire deux pages"