Bonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
Poste ton code.
Cordialement.
DanielBonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
Poste ton code.
Cordialement.
Daniel
Bonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
Poste ton code.
Cordialement.
DanielBonjour,
J'ai un souci avec un combo en Excel 2010.
J'explique.
Je crée un combo via le VBA:
a) je donne ses propriétées (coordonnées x et y, largeur et hauteur).
b) je la rempli
c) je l'affiche.
Sous Excel 2003, tout fonctionne correctement.
En Excel 2010, il y a un attribut "Lock aspect ratio".
En cherchant sur Internet, je vois que cet attribut, est par défaut, en
office 2010 sur "true".
Résultat, quand je donne une valeur (comme la largeur par ex), et bien
j'obtiens un combo qui prend une hauteur démesurée.
Si j'enlève (manuellement), cet attribut, tout fonctionne correctement.
D'où ma question à 0.0000001 ¤ : Comment, par VBA, enlever cet attribut ?
Remarque:
J'ai trouvé sur Internet la commande LockAspectRatio = true or false.
Cette propriété ne s'applique qu'aux shapes (rectangle, cercle, flèche,
photo) pas le combo.
Merci pour votre aide
André
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$1@speranza.aioe.org>, DanielCo says...
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
Daniel
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$1@speranza.aioe.org>, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow - alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
J'aimerais bien vous aider
J'aimerais bien vous aider
J'aimerais bien vous aider
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
Daniel
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$1@speranza.aioe.org>, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Bonjour
Il y a TOUJOURS moyen....
Tu prends ton fichier, tu remplaces les noms ou données à caractère privé,
puis tu vas sur CJOINT....
Par ces temps pluvieux et brumeux, les boules de cristal sont moins
efficaces. Alors, si tu peux aider ton répondeur à t'aider, ce sera le Top.
Jacquouille
" Le vin est au repas ce que le parfum est à la femme."
"André" a écrit dans le message de groupe de discussion :
Bonjour,
J'aimerais bien vous aider, mais, je viens de recevoir la réponse de mon
chef,
je ne peux pas.
Par contre,
1° ce que j'ai trouvé et qui fonctionne à 80%:
Dans la procédure de ce matin, j'ai ajouté AVANT les propriétés de taille et
position, les 2 lignes suivantes:
nom = combo.Name
ActiveSheet.Shapes(nom).LockAspectRatio = msoFalse ou msoTrue
Pour une raison qui m'échappe, de temps à autre, cela ne fonctionne pas.
2° Le code ci-dessous est le code d'appel de la procédure que j'ai donné ce
matin. Ce code est derriere l'évènement "SelectionChange" de la feuille
Excel.
En fonction de la cellule selectionnée, il affichera le combo associé.
Les variables à droite du "=" sont des constantes.
Les variables à gauche du "=" sont les valeurs des cellules.
En temps normal, ces cellules sont vides. Si l'utilisateur modifie le
contenu, a
ce moment, le combo associé s'affiche.
C'est vrais que j'aurais pu utiliser le "Select / Case"
If chemicalProductsRapex = rapexCat Then ' Display Chemical Products
showComboCategory main.comboChemicalProducts, chemicalProducts, topRow
ElseIf clothingRapex = rapexCat Then ' Display Clothing
showComboCategory main.comboClothing, clothing, topRow
ElseIf communicationRapex = rapexCat Then ' Display Communication
showComboCategory main.comboCommunication, communication, topRow
ElseIf constructionProductsRapex = rapexCat Then ' Display Construction
Products
showComboCategory main.comboConstructionProducts, constructionProducts,
topRow
ElseIf electricalRapex = rapexCat Then ' Display Electrical
showComboCategory main.comboElectrical, electrical, topRow
ElseIf hobbyRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboHobby, hobby, topRow
ElseIf machineryRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboMachinery, machinery, topRow
ElseIf otherRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboOther, other, topRow
End If
André
In article <507ec064$0$2355$, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...
Bonjour
Il y a TOUJOURS moyen....
Tu prends ton fichier, tu remplaces les noms ou données à caractère privé,
puis tu vas sur CJOINT....
Par ces temps pluvieux et brumeux, les boules de cristal sont moins
efficaces. Alors, si tu peux aider ton répondeur à t'aider, ce sera le Top.
Jacquouille
" Le vin est au repas ce que le parfum est à la femme."
"André" a écrit dans le message de groupe de discussion :
k5mh9102v32@drn.newsguy.com...
Bonjour,
J'aimerais bien vous aider, mais, je viens de recevoir la réponse de mon
chef,
je ne peux pas.
Par contre,
1° ce que j'ai trouvé et qui fonctionne à 80%:
Dans la procédure de ce matin, j'ai ajouté AVANT les propriétés de taille et
position, les 2 lignes suivantes:
nom = combo.Name
ActiveSheet.Shapes(nom).LockAspectRatio = msoFalse ou msoTrue
Pour une raison qui m'échappe, de temps à autre, cela ne fonctionne pas.
2° Le code ci-dessous est le code d'appel de la procédure que j'ai donné ce
matin. Ce code est derriere l'évènement "SelectionChange" de la feuille
Excel.
En fonction de la cellule selectionnée, il affichera le combo associé.
Les variables à droite du "=" sont des constantes.
Les variables à gauche du "=" sont les valeurs des cellules.
En temps normal, ces cellules sont vides. Si l'utilisateur modifie le
contenu, a
ce moment, le combo associé s'affiche.
C'est vrais que j'aurais pu utiliser le "Select / Case"
If chemicalProductsRapex = rapexCat Then ' Display Chemical Products
showComboCategory main.comboChemicalProducts, chemicalProducts, topRow
ElseIf clothingRapex = rapexCat Then ' Display Clothing
showComboCategory main.comboClothing, clothing, topRow
ElseIf communicationRapex = rapexCat Then ' Display Communication
showComboCategory main.comboCommunication, communication, topRow
ElseIf constructionProductsRapex = rapexCat Then ' Display Construction
Products
showComboCategory main.comboConstructionProducts, constructionProducts,
topRow
ElseIf electricalRapex = rapexCat Then ' Display Electrical
showComboCategory main.comboElectrical, electrical, topRow
ElseIf hobbyRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboHobby, hobby, topRow
ElseIf machineryRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboMachinery, machinery, topRow
ElseIf otherRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboOther, other, topRow
End If
André
In article <507ec064$0$2355$426a74cc@news.free.fr>, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
Daniel
Bonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$1@speranza.aioe.org>, DanielCo says...
Bonjour
Il y a TOUJOURS moyen....
Tu prends ton fichier, tu remplaces les noms ou données à caractère privé,
puis tu vas sur CJOINT....
Par ces temps pluvieux et brumeux, les boules de cristal sont moins
efficaces. Alors, si tu peux aider ton répondeur à t'aider, ce sera le Top.
Jacquouille
" Le vin est au repas ce que le parfum est à la femme."
"André" a écrit dans le message de groupe de discussion :
Bonjour,
J'aimerais bien vous aider, mais, je viens de recevoir la réponse de mon
chef,
je ne peux pas.
Par contre,
1° ce que j'ai trouvé et qui fonctionne à 80%:
Dans la procédure de ce matin, j'ai ajouté AVANT les propriétés de taille et
position, les 2 lignes suivantes:
nom = combo.Name
ActiveSheet.Shapes(nom).LockAspectRatio = msoFalse ou msoTrue
Pour une raison qui m'échappe, de temps à autre, cela ne fonctionne pas.
2° Le code ci-dessous est le code d'appel de la procédure que j'ai donné ce
matin. Ce code est derriere l'évènement "SelectionChange" de la feuille
Excel.
En fonction de la cellule selectionnée, il affichera le combo associé.
Les variables à droite du "=" sont des constantes.
Les variables à gauche du "=" sont les valeurs des cellules.
En temps normal, ces cellules sont vides. Si l'utilisateur modifie le
contenu, a
ce moment, le combo associé s'affiche.
C'est vrais que j'aurais pu utiliser le "Select / Case"
If chemicalProductsRapex = rapexCat Then ' Display Chemical Products
showComboCategory main.comboChemicalProducts, chemicalProducts, topRow
ElseIf clothingRapex = rapexCat Then ' Display Clothing
showComboCategory main.comboClothing, clothing, topRow
ElseIf communicationRapex = rapexCat Then ' Display Communication
showComboCategory main.comboCommunication, communication, topRow
ElseIf constructionProductsRapex = rapexCat Then ' Display Construction
Products
showComboCategory main.comboConstructionProducts, constructionProducts,
topRow
ElseIf electricalRapex = rapexCat Then ' Display Electrical
showComboCategory main.comboElectrical, electrical, topRow
ElseIf hobbyRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboHobby, hobby, topRow
ElseIf machineryRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboMachinery, machinery, topRow
ElseIf otherRapex = rapexCat Then ' Display Hobby
showComboCategory main.comboOther, other, topRow
End If
André
In article <507ec064$0$2355$, DanielCo says...
Poste ton classeur sur cjoint.com en ôtant les données confidentielles,
parce que je ne vois pas la création du combobox dans le code que tu as
posté.
DanielBonjour,
Merci de réagir si rapidement
Voici mon code
Les paramètres:
combo: le nom du combo à afficher
dict: les données à remplir
topRow: n° de ligne ou sera placé le combo
Les 2 procédures:
hideAllControls: Un seul combo doit apparaitre à l'écran. Cache tous les
autres. prepareComboBox: rempli le combo avec les données.
Sub showComboCategory(combo As ComboBox, dict As Dictionary, topRow As
Long)
hideAllControls
prepareComboBox combo, dict
combo.Activate
combo.Left = main.Cells(topRow, "C").Left
combo.Top = main.Cells(topRow, "C").Top
combo.height = main.Cells(topRow, "C").height + main.Cells(topRow + 1,
"C").height
combo.Width = main.Cells(topRow + 1, "J").Left - main.Cells(topRow,
"C").Left
textLeftLable "F6", selectedLabel, "G6", str((topRow -
alertsStartRow -
11) /
alertAreaHeight)
End Sub
Merci de votre aide
André
In article <k5lsgr$sk6$, DanielCo says...