slt,
j'ai essayé un tas de solution que j'ai trouvé sur google mais rien n'a marché avec moi.. je dois chercher la position de la ligne selon des critères(type d'établissement,liste,catégorie audit,puis la dernière ligne dans cette catégorie),insérer une ligne vide dans cette position puis la remplir avec des données saisies par l'utilisateur dans un formulaire (ci dessous mon fichier de travail)
j'ai trouver un macro excel qui insère une ligne a la fin du tableau excel :
ce code marche très bien mais je sais pas comment l'adapter a mon travail
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44 Sub Macro1() derl = ActiveSheet.Range("a65536").End(xlUp).Row Rows(derl & ":" & derl).Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Range(Cells(derl, 1), Cells(derl, 7)).Select With Selection.Borders(xlEdgeLeft) .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .Weight = xlThin End With Range(Cells(derl + 1, 1), Cells(derl + 1, 7)).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .Weight = xlMedium End With With Selection.Borders(xlEdgeTop) .Weight = xlMedium End With With Selection.Borders(xlEdgeBottom) .Weight = xlMedium End With With Selection.Borders(xlEdgeRight) .Weight = xlMedium End With With Selection.Borders(xlInsideVertical) .Weight = xlThin End With Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Cells(derl + 2, 1).Select End Sub
merci pour l'aide
Partager