after i create a button what to do to display a picture from c: when i push that button in excel 2010
i need the full macro text to assign .
thanks
after i create a button what to do to display a picture from c: when i push that button in excel 2010
i need the full macro text to assign .
thanks
Last edited by yeghia; 03-23-2014 at 07:17 PM.
Could you be a little more explicit?
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
Try the below attached to your button:
It will place the selected picture to the Activecell.
Sub Add_Picture() Application.ScreenUpdating = False Dim WB As Workbook Dim SH As Worksheet Dim rng As Range Dim myPic As Picture Dim res As Variant Set WB = ActiveWorkbook res = Application.GetOpenFilename _ ("Image Files (*.jpg), *.jpg") If res = False Then Exit Sub Set SH = ActiveSheet Set rng = ActiveCell Set myPic = SH.Pictures.Insert(res) With myPic .Top = rng.Top .Left = rng.Left myPic.ShapeRange.LockAspectRatio = msoFalse ' Below to modify the size of the picture if required myPic.ShapeRange.Height = 175# myPic.ShapeRange.Width = 235.5 myPic.ShapeRange.Rotation = 0# End With Application.ScreenUpdating = True End Sub
Last edited by coreytroy; 03-23-2014 at 11:22 PM.
thank you that was very useful and working .
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks