vandango05
Board Regular
- Joined
- Oct 6, 2008
- Messages
- 110
Hi, i'm using the following ShowPic code, however I would like the images to right align instead of left. I've changed the lefts to right, but it doesn't work. Any ideas?
Code:
Function ShowPicR(PicFile As String) As Boolean'Same as ShowPic except deletes previous picture when picfile changes
Dim AC As Range
Static P As Shape
On Error GoTo Done
Set AC = Application.Caller
If PicExistsR(P) Then
P.Delete
Else
'look for a picture already over cell
'For Each P In Worksheets("Quotation").Shapes
For Each P In ActiveSheet.Shapes
If P.Type = msoLinkedPicture Then
If P.Left >= AC.Left And P.Left < AC.Left + AC.width Then
If P.Top >= AC.Top And P.Top < AC.Top + AC.height Then
P.Delete
Exit For
End If
End If
End If
Next P
End If
'Set P = Worksheets("Quotation").Shapes.AddPicture(PicFile, True, True, AC.Left, AC.Top, 160, 40)
Set P = ActiveSheet.Shapes.AddPicture(PicFile, True, True, AC.Left, AC.Top, 131.4, 67.89)
ShowPicR = True
Exit Function
Done:
ShowPicR = False
End Function