Help with Changing ShowPicD to Right Align Pictures

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
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,216,036
Messages
6,128,432
Members
449,452
Latest member
Chris87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top