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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,240
Messages
6,170,959
Members
452,369
Latest member
January1991

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