Hi,
I have a workbook with multiple protected sheets.
What I want to do is run a Macro that will copy and paste all my unlocked cells to values.
I found on this forum someone answering this however it was just for a selection or column D.
I need the macro to run the whole work book.
Any help would be greatly appreciated.
Will
Sub ConvertUnlockedFormulasToValuesIfNextToBlankCells()
Dim FirstAddress As String, Cell As Range
Application.FindFormat.Clear
Application.FindFormat.Locked = False
Set Cell = Columns("D").Find("", SearchFormat:=True)
If Not Cell Is Nothing Then
FirstAddress = Cell.Address
Do
If Cell.Offset(, -1) = "" Then Cell.Value = Cell.Value
Set Cell = Columns("D").Find("", Cell, SearchFormat:=True)
Loop While Not Cell Is Nothing And Cell.Address <> FirstAddress
End If
Application.FindFormat.Clear
End Sub
I have a workbook with multiple protected sheets.
What I want to do is run a Macro that will copy and paste all my unlocked cells to values.
I found on this forum someone answering this however it was just for a selection or column D.
I need the macro to run the whole work book.
Any help would be greatly appreciated.
Will
Sub ConvertUnlockedFormulasToValuesIfNextToBlankCells()
Dim FirstAddress As String, Cell As Range
Application.FindFormat.Clear
Application.FindFormat.Locked = False
Set Cell = Columns("D").Find("", SearchFormat:=True)
If Not Cell Is Nothing Then
FirstAddress = Cell.Address
Do
If Cell.Offset(, -1) = "" Then Cell.Value = Cell.Value
Set Cell = Columns("D").Find("", Cell, SearchFormat:=True)
Loop While Not Cell Is Nothing And Cell.Address <> FirstAddress
End If
Application.FindFormat.Clear
End Sub