Hello !
J'ai un petit soucis, avec ce code :Je comprends pas trop pourquoi il me rentre le nom et prenom que sur le classeur où est l'userform.. Alors que je voudrais qu'il mette le nom et prénom dans chaque classeur et dans chaque feuille où la colonne "nom" et "prenom" sont présente (sur la même ligne également)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 Dim Nom As String, Prenom As String Dim DerLign As Variant, i As Variant 'On stocke les variables entrées sur l'UF Nom = Me.T_nom Prenom = Me.T_Prenom 'Boucle sur les classeurs Dim wb As Workbook, ws As Worksheet For Each wb In Application.Workbooks For Each ws In wb.Worksheets DerLign = Range("A" & Rows.Count).End(xlUp).Row 'Rentre le nom Dim rNom As Range Dim ColNom As Integer Set rNom = Rows(1).Find("nom", , xlValues, xlWhole) If Not rNom Is Nothing Then ColNom = rNom.Column Cells(DerLign + 1, ColNom) = Nom 'Rentre le prenom Dim rPrenom As Range Dim ColPrenom As Integer Set rPrenom = Rows(1).Find("prenom", , xlValues, xlWhole) If Not rPrenom Is Nothing Then ColPrenom = rPrenom.Column Cells(DerLign + 1, ColPrenom) = Prenom Next ws Next wb
C'est sûrement bête, mais j'arrive pas à trouver de solution...
Partager