Hi all,
I'd like to know how to rotate a image (jpg) I inserted in my excel sheet. I have tried activesheet.shaperange.rotation, but I get an error (cannot edit the value). I hope you can help me out here.
Yours truly,
Berend Botje
Printable View
Hi all,
I'd like to know how to rotate a image (jpg) I inserted in my excel sheet. I have tried activesheet.shaperange.rotation, but I get an error (cannot edit the value). I hope you can help me out here.
Yours truly,
Berend Botje
For those of you interested in the code I use:
Sub InsertJPG
ActiveSheet.Pictures.Insert("C:\PicturesToInsert\Picture1.jpg").Select
Call GetAngle
Call DoRotation
End sub
Sub GetAngle
ChooseAgain:
Angle = InputBox("Select Rotation. (1-4)", "Angle", "1", 400)
If Angle = "" Then
MsgBox "Choose one please.", vbOKOnly, "Error"
GoTo ChooseAgain
End If
If IsNumeric(Angle) = True Then
Angle = CInt(Angle)
Else: MsgBox "Only 1-4 please. No text.", vbOKOnly, "Error"
GoTo ChooseAgain
End If
If Again < 1 Or Again > 4 Then GoTo ChooseAgain
End Sub
Sub DoRotation()
Dim ANG As Integer
If Angle = 1 Then
ANG = 0
ElseIf Angle = 2 Then
ANG = 90
ElseIf Angle = 3 Then
ANG = 180
ElseIf Angle = 4 Then
ANG = 270
End If
Selection.ShapeRange.Rotation = ANG
End Sub
The subs are all in different modules and Angle is defined as Public.
Low response rate on this forum... Is there any other forum where I can leave this question?