Bonjour
J'ai un souci pour redimensionner une plage nommée dans un classeur destiné à Excel 2003 et Excel 2007.
Mon code est exécuté mais semble ne pas être pris en compte.
Je n'obtiens aucune erreur mais quand je vérifie ma plage nommée après exécution de la macro, rien n'a été changé.
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
33For Each objNom In ActiveWorkbook.Names 'Scinde le nom pour récupérer : 'la référence : Tableau(0) 'et 'Le nom : Tableau(1) If objNom.Name = definitionNameKeys Then findNamedRangeKeys = True tableau = Split(objNom.RefersTo, "!") 'Redimensionne le nom 'MsgBox objNom.Name + " " + tableau(0) + " " + tableau(1) ThisWorkbook.Names.Add _ Name:=objNom.Name, _ RefersTo:=tableau(0) & "!" & _ range(tableau(1)).Resize(nbKeysREF).Address End If If objNom.Name = definitionNameValues Then findNamedRangeValues = True tableau = Split(objNom.RefersTo, "!") 'Redimensionne le nom ThisWorkbook.Names.Add _ Name:=objNom.Name, _ RefersTo:=tableau(0) & "!" & _ range(tableau(1)).Resize(nbKeysREF).Address End If If findNamedRangeKeys = True And findNamedRangeValues = True Then Exit For End If Next objNom
Auriez-vous une idée ?
Merci d'avance









Répondre avec citation
Partager