Eric Strobel
New Member
- Joined
- Oct 4, 2018
- Messages
- 4
I currently am able to use vba to comment a picture I have rooted in a specific cell, but am having trouble sizing it properly. My current code is below:
Sub Comment()
Set rng = ActiveSheet.Cells(9, 1)
rng.AddComment
rng.Comment.Text Text:=""
rng.Comment.Shape.Fill.UserPicture (Sheets("Metrics").Range("B31"))
rng.Comment.ShapeRange.ScaleWidth = Sheets("Metrics").Range("I44")
rng.Comment.ShapeRange.ScaleHeight = Sheets("Metrics").Range("K44")
End Sub
As stated prior, the image with root in B31 is inserted without any issues, but I can't get the comment to scale by the values in cells I44 and K44.
Any help would be appreciated, as I am not really sure what I am doing wrong. Thanks in advance,
Eric
Sub Comment()
Set rng = ActiveSheet.Cells(9, 1)
rng.AddComment
rng.Comment.Text Text:=""
rng.Comment.Shape.Fill.UserPicture (Sheets("Metrics").Range("B31"))
rng.Comment.ShapeRange.ScaleWidth = Sheets("Metrics").Range("I44")
rng.Comment.ShapeRange.ScaleHeight = Sheets("Metrics").Range("K44")
End Sub
As stated prior, the image with root in B31 is inserted without any issues, but I can't get the comment to scale by the values in cells I44 and K44.
Any help would be appreciated, as I am not really sure what I am doing wrong. Thanks in advance,
Eric