LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Name picture in code, How.

The below code inserts a picture into the active cell,
But i want ot name the picture a value in the cell above and 1 column to the
right of the cell where the picture is added.
This way i can then use another code to delete it by value.

Can some one assist me ?

Sub Picture_Adder()
Application.ScreenUpdating = False
Call WrkShtPUnP
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim myPic As Picture
Dim res As Variant
'Const sAddress As String = ActiveCell
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
myPic.ShapeRange.Height = 175#
myPic.ShapeRange.Width = 235.5
myPic.ShapeRange.Rotation = 0#
'myPic.Name = Cells(-1, 1).Value ' <=== Get this to work ??
End With
Call WrkShtPPrt
Application.ScreenUpdating = True


Corey....


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert a picture in to a comment but picture not save on hard disk Pablo Excel Discussion (Misc queries) 0 February 21st 07 03:48 PM
Insert Picture in Pivot Table with code VB ancasa Excel Programming 0 May 30th 05 04:11 PM
Running code after a picture has been inserted? Tom Jones Excel Programming 1 January 18th 05 04:38 PM
Code to Insert a picture using VC++ keepitcool Excel Programming 1 May 28th 04 03:01 PM
What's wrong with this picture? VBA Date code.. mriley Excel Programming 2 October 17th 03 05:56 PM


All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"