Copy Paste all unlocked cells within work book with values over existing formula cells

MDK86

New Member
Joined
Oct 14, 2020
Messages
1
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
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
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,214,559
Messages
6,120,203
Members
448,951
Latest member
jennlynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top