Option Explicit
Public Const nom_image = "\toto.jpg"
Set RECHERCHE = Application.FileDialog(msoFileDialogFolderPicker)
With RECHERCHE
.Title = " CHOISIR UN DOSSIER"
.AllowMultiSelect = False
If .Show = -1 Then
For Each CHOIXDOSSIER In .SelectedItems
DOSSIER_CHOISI = CHOIXDOSSIER
Next CHOIXDOSSIER
Else 'j'ai ajouter ce bout de code pour sortir quand
Me.Hide ' on répond annuler à la question
Exit Sub
End If
End With
for i=1 to nb
if toto(i)="truc" then
'blabla
'tototititutu
'tototititutu
'tototititutu
'tototititutu
else
'tototititutu
'tototititutu
'tototititutu
'tototititutu
end if
'tototititutu
'tototititutu
next i
'limitation des curseurs au dimensions de l'image1
z_X = Application.Max(Application.Min(X - Me.Image1.Left, Me.Image1.Width), 0)
z_y = Application.Max(Application.Min(Y - Me.Image1.Top, Me.Image1.Height), 0)
z_X = Application.Max(Application.Min(X, Me.Image1.Width), 0)
z_y = Application.Max(Application.Min(Y, Me.Image1.Height), 0)
Sub CHARGEMENT_IMAGE()
Dim SH As Shape
Dim CO As ChartObject
CHEMIN = ThisWorkbook.Path & "\PROVISOIRE.jpg"
Set S = Sheets("ACCUEIL")
Set SH = S.Shapes("SUJET")
SH.Width = 130
SH.Height = 130
Set CO = S.ChartObjects.Add(SH.Left, SH.Top, SH.Width, SH.Height)
SH.Copy
With CO.Chart
.Paste
.Export Filename:=CHEMIN
End With
CO.Delete
UserForm1.Image1.Picture = LoadPicture(CHEMIN)
Kill CHEMIN
End Sub