LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default can pictures be inserted into comments

One way...

Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range
Dim testStr As String
Dim PictFileName As String

Set myRng = Selection
For Each myCell In myRng.Cells

PictFileName = myCell.Offset(0, -1).Value

testStr = ""
On Error Resume Next
testStr = Dir(PictFileName)
On Error GoTo 0

If testStr = "" Then
'do nothing, picture not found
Else
If myCell.Comment Is Nothing Then
myCell.AddComment Text:="new comment here!" 'or ""
End If
myCell.Comment.Shape.Fill.UserPicture PictFileName
End If

Next myCell

End Sub

This assumes that the full filename of the picture that should be used is to the
left of the cell.

Select your range that should get the comments and try it out.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

tryer wrote:

Can anyone tell me if it is possible to insert a number of pictures (one
for each cell in a column) automatically. I can do this manually but
would like to automate the process for say 100 rows. I have the picture
jpeg number in an adjacent cell in the same row.

Thanks in advance

--
tryer
------------------------------------------------------------------------
tryer's Profile: http://www.excelforum.com/member.php...o&userid=16546
View this thread: http://www.excelforum.com/showthread...hreadid=466666


--

Dave Peterson
 
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
Inserted Pictures are very Large Janet Excel Discussion (Misc queries) 0 February 28th 08 08:22 AM
my inserted pictures are always aligned to a cell Duangruthai Excel Discussion (Misc queries) 2 April 20th 06 02:57 PM
Pictures inserted into a message disappear Anomalia Excel Discussion (Misc queries) 1 December 24th 05 02:51 PM
Inserted Pictures Do Appear jyoon Excel Discussion (Misc queries) 0 June 9th 05 04:44 PM
Resize and resample pictures inserted Bert[_3_] Excel Programming 0 November 7th 04 07:37 PM


All times are GMT +1. The time now is 04:04 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"