Hi,
I have a worksheet "details" where if "valDetailsPosition" value is changed then on worksheet "Sheet1" image "imgDetails" is visible in top, left cell defined as "labelcovercell" range.
This work good until I set a protection in "Sheet1" sheet. It causes that the image "imgDetails" is not changing their position on "Sheet1" in range defined in "labelcovercell" (is still at the same place).
I noticed that it works when I set a protection with
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True
and it doesn't when protection is set as
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Can someone write me how to protect that sheet so that the image change their positin and the user can not select it?
Below whole code located in "details" sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim labelcovercell As String
Dim ShName As Worksheet
Dim Rng As Range
labelcovercell = Worksheets("details").Range("valDetailsPosition").Value
Set ShName = ActiveWorkbook.Worksheets("Sheet1")
Set Rng = ShName.Range(labelcovercell)
If Not Intersect(Target, Range("valDetailsPosition")) Is Nothing Then
With Sheets("Sheet1")
With .Shapes("imgDetails")
.Left = .Parent.Range(labelcovercell).Left
.Top = .Parent.Range(labelcovercell).Top
End With
.Shapes("imgDetails").Visible
End With
End If
End Sub
Bookmarks