OVH Cloud OVH Cloud

RECHERCHER UNE IMAGE

25 réponses
Avatar
GARAULT
Comment peut on ouvrir un fichier image et l'intégré dans exel.
voici le chemin que je dois prendre pour aller chercher l'image:
C:\D-calc\INTEX\Devis\D0001.AFF\141_very_big.bmp

dans le tableu 141 correspond a l'image que exel va devoir prendre
et D0001 dans le fichier que l'image se situe


A B C D E
1
2 141 D0001
3
4
5
6

MERCI

10 réponses

1 2 3
Avatar
DarthMac
*Bonjour GARAULT*,


JLuc,

Je crois qu'il n'a toujours pas compris... ;-)

mac

Avatar
GARAULT
Bonjour, tout d'abord.

merci sa fonctionne.
J'ai une question, comment faire pour que la macro se lance toute seule ?
ya t'il possibilitée d'actualiser automatiquement dès que la cellule c9
change ?

"JLuc" wrote:

*Bonjour GARAULT*,
Voila, après quelque tests, je te delivre le code magique :

Sub InsertImage()
'
'Les cellules G12 à H15 sont fusionnées
'
On Error Resume Next 'Pour le cas où il n'y a pas d'image
ActiveSheet.Shapes("MonImage").Delete
Range("G12").Select
ActiveSheet.Pictures.Insert(Range("J23")).Select
With Selection.ShapeRange
.LockAspectRatio = msoTrue 'Garde les proportions
.Height = 50# 'Pour donner à peu près la hauteur de la cellule
.Name = "MonImage" 'Donne un nom à l'image
End With
Range("C9").Select
End Sub


merci c sympas


GARAULT avait soumis l'idée :
vous voyez c que je souhaites faire, c possible ?

Oui, mais il faut que je prenne un petit moment :oÞ Et là, j'ai pas

trop le temps. Je m'y plonge en fin d'aprés midi :')

--
JLuc






--
____
( O | O )
--
_oooO_ JLuc _Oooo_

O-O








Avatar
JLuc
GARAULT avait soumis l'idée :
Bonjour, tout d'abord.

merci sa fonctionne.
J'ai une question, comment faire pour que la macro se lance toute seule ?
ya t'il possibilitée d'actualiser automatiquement dès que la cellule c9
change ?


Dans le : Private Sub Worksheet_Change(ByVal Target As Range)
Tu lance la macro à chaque changement de la cellule

--
JLuc

Avatar
GARAULT
moi je suis obligé de lancer la macro manuellement sinon il ne se passe rien

et quand je change la valeur de c9 il faut que je relance la macro
manuellement que que la nouvelle image correspondante change...


GARAULT avait soumis l'idée :
Bonjour, tout d'abord.

merci sa fonctionne.
J'ai une question, comment faire pour que la macro se lance toute seule ?
ya t'il possibilitée d'actualiser automatiquement dès que la cellule c9
change ?


Dans le : Private Sub Worksheet_Change(ByVal Target As Range)
Tu lance la macro à chaque changement de la cellule

--
JLuc






Avatar
JLuc
GARAULT avait soumis l'idée :
moi je suis obligé de lancer la macro manuellement sinon il ne se passe rien

et quand je change la valeur de c9 il faut que je relance la macro
manuellement que que la nouvelle image correspondante change...


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C9")) Is Nothing Then
InsertImage
End If
End Sub

Et ceci dans le code de la feuille concernée

--
JLuc

Avatar
GARAULT
VOICI LA FORMULE MAIS SA NE S ACTUALISE PAS YA UNE ERREURE ?

Private Sub Worksheet_Change(ByVal Target As range)
If Not Intersect(Target, range("C10")) Is Nothing Then
InsertImage
End If






***********************************************************
AUTRES DONNEES

If Not Intersect(Target, range("D11")) Is Nothing Then
If [d11] = "Ens." Then MsgBox "Attention cela vous oblige à sélectionner
une option dans la colonne suivante."
End If

End Sub

************************************************************



Sub InsertImage()
'
'Les cellules G12 à H15 sont fusionnées
'
On Error Resume Next 'Pour le cas où il n'y a pas d'image
ActiveSheet.Shapes("MonImage").Delete
range("G12").Select
ActiveSheet.Pictures.Insert(range("s5")).Select
With Selection.ShapeRange
.LockAspectRatio = msoTrue 'Garde les proportions
.Height = 100# 'Pour donner à peu près la hauteur de la cellule
.Name = "MonImage" 'Donne un nom à l'image
End With
range("c10").Select
End Sub









GARAULT avait soumis l'idée :
moi je suis obligé de lancer la macro manuellement sinon il ne se passe rien

et quand je change la valeur de c9 il faut que je relance la macro
manuellement que que la nouvelle image correspondante change...


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C9")) Is Nothing Then
InsertImage
End If
End Sub

Et ceci dans le code de la feuille concernée

--
JLuc






Avatar
JLuc
Fais un copier coller de ta macro

--
JLuc
Avatar
GARAULT
Private Sub Worksheet_Change(ByVal Target As range)
If Not Intersect(Target, range("C10")) Is Nothing Then
InsertImage
End If


If Not Intersect(Target, range("D11")) Is Nothing Then
If [d11] = "Ens." Then MsgBox "Attention cela vous oblige à sélectionner
une option dans la colonne suivante."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 1 vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 Soufflet" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 Soufflets" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 Soufflets" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 Soufflets" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 Soufflets" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 Soufflets" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 3 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 4 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 5 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 OF 6 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 O Italienne" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 POF 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 POF 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 POE 1vt" Then MsgBox "Attention. Penssez à selectionner un
élément de la colonne suivante afin de compléter entièrement votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 POE 2 vtx" Then MsgBox "Attention. Penssez à selectionner
un élément de la colonne suivante afin de compléter entièrement votre
châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 P va et vient 1 vt" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 P va et vient 2 vtx" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "1 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "2 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "3 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "4 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "5 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If
If Not Intersect(Target, range("e11")) Is Nothing Then
If [e11] = "6 Châssis fixe" Then MsgBox "Attention. Penssez à
selectionner un élément de la colonne suivante afin de compléter entièrement
votre châssis."
End If

End Sub


Sub InsertImage()
'
'Les cellules G12 à H15 sont fusionnées
'
On Error Resume Next 'Pour le cas où il n'y a pas d'image
ActiveSheet.Shapes("MonImage").Delete
range("G12").Select
ActiveSheet.Pictures.Insert(range("s5")).Select
With Selection.ShapeRange
.LockAspectRatio = msoTrue 'Garde les proportions
.Height = 100# 'Pour donner à peu près la hauteur de la cellule
.Name = "MonImage" 'Donne un nom à l'image
End With
range("c10").Select
End Sub






Fais un copier coller de ta macro

--
JLuc





Avatar
JLuc
Alors, déjà : une chose étrange, Range est un mot clé de vb donc,
normalement, l'éditeur met une majuscule.
Ensuite, la procédure InsertImage doit être dans un module standard.
Pour la cellule E11, tu devrais passer par un Select Case
Mais entre nous, si tu affiche le même message, pas besoin de tester la
valeur, si elle change affiche le message, point


GARAULT avait soumis l'idée :


Private Sub Worksheet_Change(ByVal Target As range)

If Not Intersect(Target, range("C10")) Is Nothing Then
InsertImage
End If


If Not Intersect(Target, range("D11")) Is Nothing Then
If [d11] = "Ens." Then MsgBox "Attention cela vous oblige à
sélectionner une option dans la colonne suivante."
End If

If Not Intersect(Target, range("e11")) Is Nothing Then
msg1 = "Attention. Penssez à selectionner un élément de la colonne
suivante afin de compléter entièrement votre châssis."
Select Case Target
Case = "1 OF 1 vt" : MsgBox msg1
Case = "2 OF 1 vt" : MsgBox msg1
Case = "3 OF 1 vt" : MsgBox msg1
Case = "4 OF 1 vt" : MsgBoxmsg1
Case = "5 OF 1 vt" : MsgBox msg1
Case = "6 OF 1 vt" : MsgBox msg1
Case = "1 Soufflet" : MsgBox msg1
Case = "2 Soufflets" : MsgBox msg1
Case = "3 Soufflets" : MsgBox msg1
Case = "4 Soufflets" : MsgBox msg1
Case = "5 Soufflets" : MsgBox msg1
Case = "6 Soufflets" : MsgBox msg1
Case = "1 OF 2 vtx" : MsgBox msg1
Case = "2 OF 2 vtx" : MsgBox msg1
Case = "3 OF 2 vtx" : MsgBox msg1
Case = "4 OF 2 vtx" : MsgBox msg1
Case = "5 OF 2 vtx" : MsgBox msg1
Case = "6 OF 2 vtx" : MsgBox msg1
Case = "1 OF 3 vtx" : MsgBox msg1
Case = "2 OF 3 vtx" : MsgBox msg1
Case = "3 OF 3 vtx" : MsgBox msg1
Case = "4 OF 3 vtx" : MsgBox msg1
Case = "5 OF 3 vtx" : MsgBox msg1
Case = "6 OF 3 vtx" : MsgBox msg1
Case = "1 OF 4 vtx" : MsgBox msg1
Case = "2 OF 4 vtx" : MsgBox msg1
Case = "3 OF 4 vtx" : MsgBox msg1
Case = "4 OF 4 vtx" : MsgBox msg1
Case = "5 OF 4 vtx" : MsgBox msg1
Case = "6 OF 4 vtx" : MsgBox msg1
Case = "1 OF 5 vtx" : MsgBox msg1
Case = "2 OF 5 vtx" : MsgBox msg1
Case = "3 OF 5 vtx" : MsgBox msg1
Case = "4 OF 5 vtx" : MsgBox msg1
Case = "5 OF 5 vtx" : MsgBox msg1
Case = "6 OF 5 vtx" : MsgBox msg1
Case = "1 OF 6 vtx" : MsgBox msg1
Case = "2 OF 6 vtx" : MsgBox msg1
Case = "3 OF 6 vtx" : MsgBox msg1
Case = "4 OF 6 vtx" : MsgBox msg1
Case = "5 OF 6 vtx" : MsgBox msg1
Case = "6 OF 6 vtx" : MsgBox msg1
Case = "1 O Italienne" : MsgBox msg1
Case = "2 O Italienne" : MsgBox msg1
Case = "3 O Italienne" : MsgBox msg1
Case = "4 O Italienne" : MsgBox msg1
Case = "5 O Italienne" : MsgBox msg1
Case = "6 O Italienne" : MsgBox msg1
Case = "1 POF 1vt" : MsgBox msg1
Case = "2 POF 1vt" : MsgBox msg1
Case = "3 POF 1vt" : MsgBox msg1
Case = "4 POF 1vt" : MsgBox msg1
Case = "5 POF 1vt" : MsgBox msg1
Case = "6 POF 1vt" : MsgBox msg1
Case = "1 POF 2 vtx" : MsgBox msg1
Case = "2 POF 2 vtx" : MsgBox msg1
Case = "3 POF 2 vtx" : MsgBox msg1
Case = "4 POF 2 vtx" : MsgBox msg1
Case = "5 POF 2 vtx" : MsgBox msg1
Case = "6 POF 2 vtx" : MsgBox msg1
Case = "1 POE 1vt" : MsgBox msg1
Case = "2 POE 1vt" : MsgBox msg1
Case = "3 POE 1vt" : MsgBox msg1
Case = "4 POE 1vt" : MsgBox msg1
Case = "5 POE 1vt" : MsgBox msg1
Case = "6 POE 1vt" : MsgBox msg1
Case = "1 POE 2 vtx" : MsgBox msg1
Case = "2 POE 2 vtx" : MsgBox msg1
Case = "3 POE 2 vtx" : MsgBox msg1
Case = "4 POE 2 vtx" : MsgBox msg1
Case = "5 POE 2 vtx" : MsgBox msg1
Case = "6 POE 2 vtx" : MsgBox msg1
Case = "1 P va et vient 1 vt" : MsgBox msg1
Case = "2 P va et vient 1 vt" : MsgBox msg1
Case = "3 P va et vient 1 vt" : MsgBox msg1
Case = "4 P va et vient 1 vt" : MsgBox msg1
Case = "5 P va et vient 1 vt" : MsgBox msg1
Case = "6 P va et vient 1 vt" : MsgBox msg1
Case = "1 P va et vient 2 vtx" : MsgBox msg1
Case = "2 P va et vient 2 vtx" : MsgBox msg1
Case = "3 P va et vient 2 vtx" : MsgBox msg1
Case = "4 P va et vient 2 vtx" : MsgBox msg1
Case = "5 P va et vient 2 vtx" : MsgBox msg1
Case = "6 P va et vient 2 vtx" : MsgBox msg1
Case = "1 Châssis fixe" : MsgBox msg1
Case = "2 Châssis fixe" : MsgBox msg1
Case = "3 Châssis fixe" : MsgBox msg1
Case = "4 Châssis fixe" : MsgBox msg1
Case = "5 Châssis fixe" : MsgBox msg1
Case = "6 Châssis fixe" : MsgBox msg1
End Select
End If

End Sub

'************ MODULE STANDARD ***************

Sub InsertImage()
'
'Les cellules G12 à H15 sont fusionnées
'
On Error Resume Next 'Pour le cas où il n'y a pas d'image
ActiveSheet.Shapes("MonImage").Delete
range("G12").Select
ActiveSheet.Pictures.Insert(range("s5")).Select
With Selection.ShapeRange
.LockAspectRatio = msoTrue 'Garde les proportions
.Height = 100# 'Pour donner à peu près la hauteur de la cellule
.Name = "MonImage" 'Donne un nom à l'image
End With
range("c10").Select
End Sub

--
JLuc

Avatar
GARAULT
Rien à faire, j'ai remis le code comme vous l'avez indiqué, mais quand la
cellule c10 change , l'image ne change pas.

il faut que je relance la macro manuellement pour que sa change l'image.





Alors, déjà : une chose étrange, Range est un mot clé de vb donc,
normalement, l'éditeur met une majuscule.
Ensuite, la procédure InsertImage doit être dans un module standard.
Pour la cellule E11, tu devrais passer par un Select Case
Mais entre nous, si tu affiche le même message, pas besoin de tester la
valeur, si elle change affiche le message, point


GARAULT avait soumis l'idée :


Private Sub Worksheet_Change(ByVal Target As range)

If Not Intersect(Target, range("C10")) Is Nothing Then
InsertImage
End If


If Not Intersect(Target, range("D11")) Is Nothing Then
If [d11] = "Ens." Then MsgBox "Attention cela vous oblige à
sélectionner une option dans la colonne suivante."
End If

If Not Intersect(Target, range("e11")) Is Nothing Then
msg1 = "Attention. Penssez à selectionner un élément de la colonne
suivante afin de compléter entièrement votre châssis."
Select Case Target
Case = "1 OF 1 vt" : MsgBox msg1
Case = "2 OF 1 vt" : MsgBox msg1
Case = "3 OF 1 vt" : MsgBox msg1
Case = "4 OF 1 vt" : MsgBoxmsg1
Case = "5 OF 1 vt" : MsgBox msg1
Case = "6 OF 1 vt" : MsgBox msg1
Case = "1 Soufflet" : MsgBox msg1
Case = "2 Soufflets" : MsgBox msg1
Case = "3 Soufflets" : MsgBox msg1
Case = "4 Soufflets" : MsgBox msg1
Case = "5 Soufflets" : MsgBox msg1
Case = "6 Soufflets" : MsgBox msg1
Case = "1 OF 2 vtx" : MsgBox msg1
Case = "2 OF 2 vtx" : MsgBox msg1
Case = "3 OF 2 vtx" : MsgBox msg1
Case = "4 OF 2 vtx" : MsgBox msg1
Case = "5 OF 2 vtx" : MsgBox msg1
Case = "6 OF 2 vtx" : MsgBox msg1
Case = "1 OF 3 vtx" : MsgBox msg1
Case = "2 OF 3 vtx" : MsgBox msg1
Case = "3 OF 3 vtx" : MsgBox msg1
Case = "4 OF 3 vtx" : MsgBox msg1
Case = "5 OF 3 vtx" : MsgBox msg1
Case = "6 OF 3 vtx" : MsgBox msg1
Case = "1 OF 4 vtx" : MsgBox msg1
Case = "2 OF 4 vtx" : MsgBox msg1
Case = "3 OF 4 vtx" : MsgBox msg1
Case = "4 OF 4 vtx" : MsgBox msg1
Case = "5 OF 4 vtx" : MsgBox msg1
Case = "6 OF 4 vtx" : MsgBox msg1
Case = "1 OF 5 vtx" : MsgBox msg1
Case = "2 OF 5 vtx" : MsgBox msg1
Case = "3 OF 5 vtx" : MsgBox msg1
Case = "4 OF 5 vtx" : MsgBox msg1
Case = "5 OF 5 vtx" : MsgBox msg1
Case = "6 OF 5 vtx" : MsgBox msg1
Case = "1 OF 6 vtx" : MsgBox msg1
Case = "2 OF 6 vtx" : MsgBox msg1
Case = "3 OF 6 vtx" : MsgBox msg1
Case = "4 OF 6 vtx" : MsgBox msg1
Case = "5 OF 6 vtx" : MsgBox msg1
Case = "6 OF 6 vtx" : MsgBox msg1
Case = "1 O Italienne" : MsgBox msg1
Case = "2 O Italienne" : MsgBox msg1
Case = "3 O Italienne" : MsgBox msg1
Case = "4 O Italienne" : MsgBox msg1
Case = "5 O Italienne" : MsgBox msg1
Case = "6 O Italienne" : MsgBox msg1
Case = "1 POF 1vt" : MsgBox msg1
Case = "2 POF 1vt" : MsgBox msg1
Case = "3 POF 1vt" : MsgBox msg1
Case = "4 POF 1vt" : MsgBox msg1
Case = "5 POF 1vt" : MsgBox msg1
Case = "6 POF 1vt" : MsgBox msg1
Case = "1 POF 2 vtx" : MsgBox msg1
Case = "2 POF 2 vtx" : MsgBox msg1
Case = "3 POF 2 vtx" : MsgBox msg1
Case = "4 POF 2 vtx" : MsgBox msg1
Case = "5 POF 2 vtx" : MsgBox msg1
Case = "6 POF 2 vtx" : MsgBox msg1
Case = "1 POE 1vt" : MsgBox msg1
Case = "2 POE 1vt" : MsgBox msg1
Case = "3 POE 1vt" : MsgBox msg1
Case = "4 POE 1vt" : MsgBox msg1
Case = "5 POE 1vt" : MsgBox msg1
Case = "6 POE 1vt" : MsgBox msg1
Case = "1 POE 2 vtx" : MsgBox msg1
Case = "2 POE 2 vtx" : MsgBox msg1
Case = "3 POE 2 vtx" : MsgBox msg1
Case = "4 POE 2 vtx" : MsgBox msg1
Case = "5 POE 2 vtx" : MsgBox msg1
Case = "6 POE 2 vtx" : MsgBox msg1
Case = "1 P va et vient 1 vt" : MsgBox msg1
Case = "2 P va et vient 1 vt" : MsgBox msg1
Case = "3 P va et vient 1 vt" : MsgBox msg1
Case = "4 P va et vient 1 vt" : MsgBox msg1
Case = "5 P va et vient 1 vt" : MsgBox msg1
Case = "6 P va et vient 1 vt" : MsgBox msg1
Case = "1 P va et vient 2 vtx" : MsgBox msg1
Case = "2 P va et vient 2 vtx" : MsgBox msg1
Case = "3 P va et vient 2 vtx" : MsgBox msg1
Case = "4 P va et vient 2 vtx" : MsgBox msg1
Case = "5 P va et vient 2 vtx" : MsgBox msg1
Case = "6 P va et vient 2 vtx" : MsgBox msg1
Case = "1 Châssis fixe" : MsgBox msg1
Case = "2 Châssis fixe" : MsgBox msg1
Case = "3 Châssis fixe" : MsgBox msg1
Case = "4 Châssis fixe" : MsgBox msg1
Case = "5 Châssis fixe" : MsgBox msg1
Case = "6 Châssis fixe" : MsgBox msg1
End Select
End If

End Sub

'************ MODULE STANDARD ***************

Sub InsertImage()
'
'Les cellules G12 à H15 sont fusionnées
'
On Error Resume Next 'Pour le cas où il n'y a pas d'image
ActiveSheet.Shapes("MonImage").Delete
range("G12").Select
ActiveSheet.Pictures.Insert(range("s5")).Select
With Selection.ShapeRange
.LockAspectRatio = msoTrue 'Garde les proportions
.Height = 100# 'Pour donner à peu près la hauteur de la cellule
.Name = "MonImage" 'Donne un nom à l'image
End With
range("c10").Select
End Sub

--
JLuc






1 2 3