Howdy, it's been a while, hope everyone is doing fine.
I have this rather simple code below that runs without errors, but it doesn't actually do what it supposed to do - copy a range of cells from one sheet to other sheets. Nothing is copied for some reason.
Could you help please.
Thanks in advance!
I have this rather simple code below that runs without errors, but it doesn't actually do what it supposed to do - copy a range of cells from one sheet to other sheets. Nothing is copied for some reason.
Could you help please.
Thanks in advance!
Code:
Sub copytoalldates()
Dim ws As Worksheet
Dim rng As Range
Set rng = ActiveWorkbook.Worksheets("June 18").Range("L24:P46")
For Each ws In ActiveWorkbook.Worksheets
If Not (ws.Name = "Year Calculator" Or ws.Name = "June 18") Then
With ws
.Unprotect
.Range("R24:V46") = rng
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
End If
Next ws
End Sub