View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Macro to insert pictures in comments

Dear Experts,
I got a Excel macro to paste pictures in Excel cell comments. It is
working fine. Now, I need a change in it. Pictures should be rotated
270 degree & then pasted in cell comments. Can anybody help, please?
Thanks in advance. code is mentioned below:-

Sub InsertPictures()
Dim cll As Range
Dim Rng As Range
Dim strPath As String
strPath = "D:\Photo Folder"
With Sheets("Sheet1")
Set Rng = Range("A2:A416")
End With
For Each cll In Rng
If Dir$(strPath & "\" & cll.Value & ".jpg") < "" Then
With cll
.ClearComments
.AddComment ("")
.Comment.Shape.Fill.UserPicture (strPath & "\" &
cll.Value & ".jpg") .Comment.Shape.Height = 160
.Comment.Shape.Width = 120
.Comment.Shape.LockAspectRatio = msoTrue
End With
End If
Next cll
End Sub


Clearly you did not use the Object Browser to see if a 'Rotation'
property exists, did you?

Why not...

.Comment.Shape.Rotation = 0.00

...where '0.00' represents the +/- degrees of rotation.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion