Bonjour au forum
je suis confronter a un petit probleme j'ai un code qui me permet d'ecrire sur mes pages aux meme lignes et les meme colonnes
le soucis ayant 71 onglets j'ai dupliquer ce code 71 fois sa fonctionne mais c'est tres long
je me demandais si il y avais une solution pour reduire le temps d'attente lors de l'execution en simple ameliorer ce code je n'ai pas mis de fichier joint car 71 onglet sa fais un peut lourd et si j'en enleve le probleme se posseras plus
à savoir que les onglets se suive (FORMATION2,FORMATION3,..........FORMATION71
merci pour votre aide
et bon week end
je suis confronter a un petit probleme j'ai un code qui me permet d'ecrire sur mes pages aux meme lignes et les meme colonnes
Code:
With Worksheets("FORMATION2")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
le soucis ayant 71 onglets j'ai dupliquer ce code 71 fois sa fonctionne mais c'est tres long
Code:
With Worksheets("FORMATION2")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION3")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION4")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION5")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION6")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION7")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION8")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION9")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION10")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION11")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION12")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION13")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION14")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION15")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION16")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION17")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION18")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION19")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION20")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION21")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION22")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION23")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION24")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION25")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION26")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION27")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION28")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION29")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION30")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION31")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION32")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION33")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION34")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION35")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION36")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION37")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION38")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION39")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION40")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION41")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION42")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION43")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION44")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION45")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION46")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION47")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION48")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION49")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION50")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION51")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION52")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION40")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION53")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION54")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION55")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION56")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION57")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION58")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION59")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION60")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION61")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION62")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION63")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION64")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION65")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION66")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION67")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION68")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION69")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION70")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
With Worksheets("FORMATION71")
DernLig = .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row + 1
TextBoxNoOrdre = Application.WorksheetFunction.Max(.Range("A5:A" & DernLig)) + 1
.Cells(DernLig, 1) = CLng(TextBoxNoOrdre)
.Cells(DernLig, 2) = TextBoxNom
.Cells(DernLig, 3) = TextBoxPrenom
.Cells(DernLig, 4) = TextBoxService
End With
je me demandais si il y avais une solution pour reduire le temps d'attente lors de l'execution en simple ameliorer ce code je n'ai pas mis de fichier joint car 71 onglet sa fais un peut lourd et si j'en enleve le probleme se posseras plus
à savoir que les onglets se suive (FORMATION2,FORMATION3,..........FORMATION71
merci pour votre aide
et bon week end