I
I think I need to rephrase the question
I am using the following Macro to insert a picture into a protected sheet
Sub testme()
Dim myPictName As Variant
Dim myPict As Picture
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
myPictName _
= Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif")
If myPictName = False Then
MsgBox "try later!"
Exit Sub
End If
With wks
.Unprotect Password:="hi"
With .Range("a1:B9")
Set myPict = .Parent.Pictures.Insert(myPictName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = .Width
myPict.Height = .Height
End With
.Protect Password:="hi"
End With
End Sub
The macro resizes a picture to fit the cell range
Is it possible to fit a picture into the cell range and keep its
proportions? (ie make it fit into the cell range and relatively keep its
normal height and width)
Additionally, can you tell the macro to enable "Edit Object" in tools -
protection - sheet protect prior to Password Protecting again?
Sub testme()
Dim myPictName As Variant
Dim myPict As Picture
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
myPictName _
= Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif")
If myPictName = False Then
MsgBox "try later!"
Exit Sub
End If
With wks
.Unprotect Password:="hi"
With .Range("a1:B9")
Set myPict = .Parent.Pictures.Insert(myPictName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = .Width
myPict.Height = .Height
End With
.Protect Password:="hi"
End With
End Sub
The macro resizes a picture to fit the cell range
Is it possible to fit a picture into the cell range and keep its
proportions? (ie make it fit into the cell range and relatively keep its
normal height and width)
Additionally, can you tell the macro to enable "Edit Object" in tools -
protection - sheet protect prior to Password Protecting again?