Hi all,
I'm hoping someone can help me with this. I have a protected excel sheet with 3 columns (all contain formulas) that I do not want others to be able to edit. These 3 columns are locked. What I need is a macro that will unlock the sheet, perform the insert row function whilst copying down the formulas from the row above, and then protect the sheet. Below is the most recent macro that I've been trying to use:
Sub InsertRowFormulas()
Sheet1.Unprotect Password:="TParks19"
Selection.EntireRow.Insert
For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset (-1, 0). EntireRow)
If cell.HasFormula Then
cell.Copy cell.Offset (1, 0)
Sheet1.Protect Password:="TParks19"
End If
Next
End Sub
This macro does what it is supposed to for column M (formula comes down with inserted row), but not O or P.
I'm at a loss here. Any help would be greatly appreciated.
I'm hoping someone can help me with this. I have a protected excel sheet with 3 columns (all contain formulas) that I do not want others to be able to edit. These 3 columns are locked. What I need is a macro that will unlock the sheet, perform the insert row function whilst copying down the formulas from the row above, and then protect the sheet. Below is the most recent macro that I've been trying to use:
Sub InsertRowFormulas()
Sheet1.Unprotect Password:="TParks19"
Selection.EntireRow.Insert
For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset (-1, 0). EntireRow)
If cell.HasFormula Then
cell.Copy cell.Offset (1, 0)
Sheet1.Protect Password:="TParks19"
End If
Next
End Sub
This macro does what it is supposed to for column M (formula comes down with inserted row), but not O or P.
I'm at a loss here. Any help would be greatly appreciated.