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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Sub PoserBaie()
Dim BaieLeft As Object
Dim BaieRight As Object
Dim nom As String
Dim Fichier As String
Dim BaieName As Object
On Error GoTo info
nom = Range("AE8")
Fichier = "D:\Users\toto\Desktop\Images\Aastra\" & nom & ".png"
Set BaieRight = ActiveSheet.Pictures.Insert(Fichier)
Set BaieLeft = ActiveSheet.Pictures.Insert(Fichier)
With BaieLeft.ShapeRange
.LockAspectRatio = msoFalse
.Top = 5.3
.Left = 75
.Height = .Height * 0.5
.Width = .Width * 0.5
End With
'
With BaieRight.ShapeRange
.LockAspectRatio = msoFalse
.Top = 5.3
.Left = 276
.Height = .Height * 0.5
.Width = .Width * 0.5
End With
For Each BaieName In ActiveSheet.Shapes
If Not Intersect(BaieName.TopLeftCell, Range("$A$1:$W$50")) Is Nothing Then
BaieName.Name = "Baie"
End If
Next BaieName
Range("AC17").MergeArea.ClearContents
Range("AG17").MergeArea.ClearContents
Range("AK17").MergeArea.ClearContents
Range("AE28").MergeArea.ClearContents
Range("AK28").MergeArea.ClearContents
Baie = 1
MsgBox "Baie posée :) "
Exit Sub
info:
MsgBox "Choix incorrect !"
End Sub |